Well, while I don't like it much, there are in fact REPLs that work
the way he expects, e.g. SBCL's:

This is SBCL 1.0.24, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses.  See the CREDITS and COPYING files in the
distribution for more information.
* (+ 1 1)

2
* 1

1
*



1

1
* 1 2 3

1
*
2
*
3
*

Here's Clojure's REPL with the same input:

Clojure 1.2.0-master-SNAPSHOT
user=> (+ 1 1)
2
user=> 1
1
user=>
user=>
user=>
user=> 1
1
user=> 1 2 3
1
2
3
user=>

By the way, these transcripts were generated with the program
'script', which is available by default on most Unix systems.

-Per

On Sat, Apr 3, 2010 at 9:45 AM, Armando Blancas
<[email protected]> wrote:
> It's clear that a REPL used interactively must respond as it does,
> otherwise it's appear hanged. Do you have a particular scenario for
> your code? I thought about recreating or documenting a session, but
> you can't see the input, only the REPL's output.
>
> On Apr 2, 12:23 am, Michael Jaaka <[email protected]>
> wrote:
>> Hi!
>>
>> I think that I've found inconsistency in REPL behavior.
>> Just press ENTER in REPL and you got new command prompt.
>> This shouldn't work like this. New line for clojure is just a
>> whitespace until it is written in quotes (with quotes it becomes an
>> important char of text content). So If it is a whitespace it can't be
>> interpreted. The interpreter should just ignore that fact and wait for
>> another input. I know that the caret will go below to the next line
>> and then it looks oddly, but it is the same when user type "( + 23" in
>> one line and will end expression with "222)" in second.
>>
>> Just test code below and you will see what implications have current
>> REPL behavior (for lazy ones, prompt is not written in new 
>> line):http://pastebin.com/nGY3ZkyF
>>
>> The output is:http://pastebin.com/fJ4X6FXA
>>
>> Notice the prompts in the same line. They are not in new line because
>> "user enter" is never rendered/interpreted by console terminal.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to [email protected]
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>
> To unsubscribe, reply using "remove me" as the subject.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to