Implied list, Implied Nesting?
Posted: Thu Nov 17, 2005 4:55 am
Small syntax goodies can really make a big difference in writing code. In my opinion the implied indexing is an excellent example of this. Thinking of these kinds of things I considered how often I write
(list a b c ...)
One instinctively wants to simplify it to just (a b c ...) but this might conflict with implied indexing if a or a and b are integers. But what if we made this simple change ( a b c ...) where we require a single space between the left parenthesis and the first argument? This would only require that we be space sensitive when writing a list but nowhere else and enable us to eliminate having to type "list".
A second idea along these lines returns me to a previous idea I had initially suggested for nested functions wherein something like
(fn3 (fn2 (fn1 x))) could be written as (fn3 fn2 fn1 | x). It occured to me that this could simply be written as the briefer (fn3 fn2 fn1 x). Couldn't the NewLISP translator recognize several function names in a row and assume nesting for the expression?
Of course there may be other issues I am not aware of but I am a minimalist at heart and am always looking for somewhere to trim something down. I think all LISPers are in search of some minimal purity of expression. In any case, I thought these two ideas would be something that could be added without disrupting any previous syntax. The coder could do it the old way or new at their discretion.
(list a b c ...)
One instinctively wants to simplify it to just (a b c ...) but this might conflict with implied indexing if a or a and b are integers. But what if we made this simple change ( a b c ...) where we require a single space between the left parenthesis and the first argument? This would only require that we be space sensitive when writing a list but nowhere else and enable us to eliminate having to type "list".
A second idea along these lines returns me to a previous idea I had initially suggested for nested functions wherein something like
(fn3 (fn2 (fn1 x))) could be written as (fn3 fn2 fn1 | x). It occured to me that this could simply be written as the briefer (fn3 fn2 fn1 x). Couldn't the NewLISP translator recognize several function names in a row and assume nesting for the expression?
Of course there may be other issues I am not aware of but I am a minimalist at heart and am always looking for somewhere to trim something down. I think all LISPers are in search of some minimal purity of expression. In any case, I thought these two ideas would be something that could be added without disrupting any previous syntax. The coder could do it the old way or new at their discretion.