Title: FreeCode Signature

(let ((a 1))
  (cond ((null a) 0)
            (t 1)))
has a lot of brackets, in my opinion too many, since it could have been
(let (a 1)
  (cond (null a) 0
             t 1))
which is also s-_expression_. However, I've got bad feelings changing
basic forms like that.
  
When I wrote sugar/I-expressions, I realized the need for having a list as the first item in another list, but that it was only used in let. As it requires a quirk in the syntax (the introduction of "group"), I came to dislike let as it looked ugly in I-expressions.
let
    group
       foo 1
       bar (+ 4 5)
    * foo bar
It would be trivial to introduce a new macro  := that only allows one assignment, and has the form (:= (variable value) _expression_), which would result in the following I-_expression_ for the above code:
:=
    foo 1
    :=
        bar (+ 4 5)
        * foo bar
which is actually even ugglier! What I would like, but what would be hard to get, is

:= (foo 1)
:= (bar (+ 4 5)
* foo bar
The problem is, how do you rewrite this into the above? If we introduced read-macros into the I-_expression_ reader, this could be done; := would be a reader macro that called readblocks for the same indentation level, consuming everything up until the end of the current block as if it was a sub-block of :=.

Another solution would be to overload eval, so that it handled arguments that where (:= something something) in a special way prior to any other parameter evaluation.

~dreaming on~

/Egil

--



Konsulent, Fri Programvare / Free Software Consultant
Cell: +47 - 91 17 05 93
Phone: +47 - 21 53 69 00, Fax: +47 - 21 53 69 09
Addr: Slemdalsveien 70, PB 1 Vinderen, 0319 Oslo

 Free beer costs nothing, freedom costs a fight.
 Free beer lasts an eavening, freedom lasts a lifetime.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to