Multi-line lists

If you have any questions, remarks, ... if you need help... its here...

Multi-line lists

Postby Bill » 14 Sep 2015 03:48

Of course, lists on one line are no problem:

Code: Select all
[2,3,4]


However, how does one get multi-line lists to work?
Code: Select all
>[2, $long-symbol-name-is-this, $another-one-is-this, 333,
[1:interpreter] Exception : Bad items list
Bill
 
Posts: 5
Joined: 14 Sep 2015 03:38

Re: Multi-line lists

Postby Franck » 14 Sep 2015 07:29

Hello,

This is a restriction when you enter code into the interpreter directly from command line : the list must be complete by the end of the line (and this is true not only for lists).

If you load your code from a file or package, there is not such a restriction : you can have lists declared on multiple lines.

Franck
Franck
 
Posts: 144
Joined: 29 Oct 2014 19:01

Re: Multi-line lists

Postby sotolf » 14 Sep 2015 12:25

Franck wrote:This is a restriction when you enter code into the interpreter directly from command line : the list must be complete by the end of the line (and this is true not only for lists).


And in the interpreter it doesn't really matter either, it's more annoying in the interpreter when I by mistake enter ä or å or some special character, and I have to remember to delete the hidden character as well, or else the interpreter will yell, I have kind of solved it now, by changing to the colemak keyboard layout where these letters aren't so close to [] :)
sotolf
 
Posts: 55
Joined: 30 Jul 2015 15:53

Re: Multi-line lists

Postby Franck » 08 Feb 2016 23:20

Hi,

With list comprehension written in Oforth (V0.9.23), there is no more this restriction.
You can enter multi-line lists also directly in the interpreter.

Franck
Franck
 
Posts: 144
Joined: 29 Oct 2014 19:01


Return to General

Who is online

Users browsing this forum: No registered users and 2 guests

cron