Title: FreeCode Signature
David A. Wheeler wrote:
I have an idea, and wonder about the pros and cons.  The basic idea is, "what if initial whitespace (space/tab) at the toplevel DISABLED I-expressions?"  (this is the REVERSE of my earlier approach).
  
Well, I don't dislike the idea, but I think that there are better solutions, namely intelligent prompting (see below).
where there's more than one _expression_ on the line will produce the same unintended thing currently.
With this new rule, once the processing of (...) ends because of any whitespace, you're done, making it more compatible.  Thus, stuff like:
 (a b c
     d e) (f g)
  
If you mean that the first line is indented then yes, this is a good idea - but, notice that it must work the I-_expression_ way if not, or you wpn't be able to mix in S-expressions within I-expressions.
2. It enables relatively easy command-line interactions.  Currently, if you have many one-line interactions at the command line, you have to press ENTER ENTER after each one.  Ugh; not only is that more keystrokes, but that quickly consumes precious vertical space.  If users insert a space before a one-line command, it can be executed immediately.
  
This could be helped by not printing the empty line of an ENTER ENTER, just the main prompt again. Consider the following session (with proper prompting:

sugar>+ 1 2
user presses ENTER
sugar>+ 1 2
----->
  
user presses ENTER again
sugar>+ 1 2
3
sugar>
  
And
sugar>+ 1 2
user presses ENTER
sugar>+ 1 2
----->
  
user enters some more expressions:
sugar>+ 1 2
-----> * 3
----->  + 5 6
----->
  
user presses ENTER
sugar>+ 1 2  
-----> * 3
----->  + 5 6
36
sugar>
Originally I had proposed using indentation to REQUIRE indentation interpretation.  But that doesn't work well, because of limitations on peeking (one-char-only) and unget (Scheme has none, Common Lisp only one char).  
Also, I must add that that would be very cumbersome in interactive mode too :(

/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