----- Start Original Message -----
Sent: Wed, 18 Jul 2012 19:28:34 -0700
From: Kartik Agaram <a...@akkartik.com>
To: Alan Manuel Gloria <almkg...@gmail.com>
Subject: Re: [Readable-discuss] Arne Babenhauserheide proposal: use "." on own
 line instead of "group"

> 
> > > b) Should we really have to insert a backslash in empty lines?
>
> The use case is when you .. you copy-paste a file's contents into
> the REPL.

a) In practice top-level forms tend to be separated by lines anyway in
files.

> b) A smart repl could notice when a line is at the same indent as the 
> previous expression, and eval the previous form. It might print things in the 
> wrong place, something like this:
>
> > + 1 2
> . 7
> 3
> 7

> Here I've colored* what the computer prints grey to distinguish from what the 
> programmer types in. So the '+ 1 2' is evaluated after he's already started 
> typing the next expression (7). I think this is ok.

The current parser *does* detect when two lines are at the top level and accept 
it.  In fact, it used to be that blank lines were ignored.  I *HATED* it.  That 
kind of interaction is absurdly confusing; nobody expects to type in something 
and see the results from the input BEFORE that.  When you're using a REPL you 
do NOT need confusing output.  This was one of the first things I fixed: Making 
sure that ENTER ENTER works.

There are certainly alternatives, e.g., a symbol that means "execute this".  
Several languages do exactly this.  But that gets to a drag interactively; it's 
hard to beat the speed of ENTER ENTER.

You don't need to use "\" to make a blank line.  A semicolon (possibly 
indented) will also cause the line to be ignored, and you don't need to match 
the indentation.  This has the disadvantage that in text files, you can't have 
truly blank lines in the middle of a form, you have to put something (like a 
semicolon) in.  Python solves this by making the interactive syntax DIFFERENT 
from syntax in code (blank lines end an expression only in interactive mode), 
but that seems like a bad idea for Lisp.

> * - With apologies to those who don't see html formatting in their email. 
> Please speak up if there's someone like that. I try to avoid html emails -- 
> until there's a genuine need for extra formatting.

Um, me for one :-).

--- David A. Wheeler

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Readable-discuss mailing list
Readable-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/readable-discuss

Reply via email to