On 7/19/12, Kartik Agaram <a...@akkartik.com> wrote:
>> > 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.

Let me clarify: you're editing a function in the file.  You're not
100% sure it's correct.  The function is a long one, so you put some
blank lines between parts of the function to organize it.  The
function is a single top-level form.  You copy-paste the function (not
the whole file!!) into the REPL so that you can experiment with it.
BOOM! your REPL gets confused by the empty lines inside your function,
which it thought was ENTER-ENTER.  You are then forced to re-edit the
function to insert \ into empty lines to prevent the REPL from
confusion.

So: using the same reader at REPL and at file is useful for this use case.

>
> 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.

Dwheeler specifically didn't like this IIRC ^^ Let's see what he says.

>
> c) If you paste in several forms into the repl at once, you might need to
> type in an extra <Enter> like in the example above (the empty line just
> above 7). I think that's acceptable as well.
>
> What do people think?
>
> * - 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.
>

------------------------------------------------------------------------------
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