Page 1 of 1

question on the reason for the [cmd]/[/cmd] multi-line tags

Posted: Mon Mar 16, 2009 5:46 am
by DekuDekuplex
In the course of discussing a recent bug (which has since been fixed) with the implementation of the multi-line [cmd]/[/cmd] tags in newLISP-GS on comp.lang.lisp, one reader there claimed in my thread potential bug in REPL in newLISP-GS in newLISP v.10.0.1, that the very existence of these tags constituted a "fatal flaw"; viz.:
There must be a fatal flaw in this system, if you have to tag your
multiline expressions with an horror such as [cmd][/cmd].

The algorithms to read expressions, whatever the number of lines, have
been know and implemented in Lisp for 50 years. Perhaps you should
try a Lisp that includes the teachings of history? Try Common Lisp.

http://clisp.cons.org has a MS-Windows executable, and when entering a
multiline expression in the emacs IDE (eg. via M-x inferior-lisp RET),
there's no discernable difference to when entering it directly in the
console.

--
__Pascal Bourguignon__
Out of curiosity, why are these tags necessary in newLISP?

-- Benjamin L. Russell

Posted: Mon Mar 16, 2009 12:17 pm
by Lutz
newLISP has a server mode used in 'net-eval' and by all front-ends controlling newLISP. Code is first transferred over a link (pipe or TCP/IP) then parsed by the newLISP translater/reader. The tags allow separation of code transfer and translation/reader and speeding up both. I am aware of parenthesis conscious Lisp code readers but they don't fit with two of newLISP's design goals: maximum speed and small code size.

When working in a Unix environment newISP is "readline" aware. "libreadline" is a Unix library used by all command shells and other programs using the command-line. This allows tab-expansion to newLISP built-in functions out of the box without any configuration and it allows to configure special keystroke-macros in a file called ".inputrc" in your home directory. One could configure special control keystrokes to write the tags for multi-line statements.

Posted: Mon Mar 16, 2009 1:50 pm
by Lutz
... I forgot to mention 'command-event' and 'prompt-event'; two functiona in newLISP which permit full customization of the interactive shell. There is an example of this here:

http://unbalanced-parentheses.nfshost.com/index.cgi

and the newLISP source distribution contains (less sophisticated, different features) example how to customize interactive mode with function help and OS access from the same command-line.

Posted: Mon Mar 16, 2009 5:02 pm
by cormullion
- but please bear in mind that my idea was only a hesitant exploration of a few of the possibilities, and will fall over at the slightest provocation. One of the main problems is that I put it in a context, so the code fails when evaluated 'out of context'. (I might mean that literally or not, I can't tell.)

Posted: Mon Mar 16, 2009 5:13 pm
by Lutz
I understand your's wasn't meant to be a finished program, rather a proof of concept; and the same is true for nls, the piece I have put in util/nls in the source distributions. Both utilities together show, that pretty much anything is possible and with relative little code.