1

I tried to run a multi line while statement in the Rebol REPL (aka, command line), like in http://www.rebol.com/docs/expert-intro.html

if size [
    print "ok"
]

I typed it line by line but after if size [, it says:

>> size: 0  
== 0

>> if size [
** Syntax error: missing "]" at "end-of-script"
** Near: (line 1) if size [

>> 

Is this a problem with the REPL, the way I am typing it, or something else?

earl
  • 40,327
  • 6
  • 58
  • 59
Cradam
  • 2,282
  • 2
  • 13
  • 8

2 Answers2

4

In the Rebol 2 REPL, this should just work. After the first line, the prompt should change into a "continuation prompt":

>> if size [
[    ;<cursor here>

In Rebol 3, the REPL currently (2013-02) does not support multi-line expressions.

earl
  • 40,327
  • 6
  • 58
  • 59
1

I too got very frustrated with this issue.

But I found a truly terrible work-around, namely: Pack up your code into a string and 'do it.

So for your example the way it can be entered is like this:

>> size: 0
== 0

>> do {if size [^/^-print "ok"^/]}
ok
>>

I warned you it was terrible, right?

MarkI
  • 347
  • 2
  • 8