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

For the Compleat Fan
Locked
DekuDekuplex
Posts: 13
Joined: Fri Mar 06, 2009 4:44 pm
Location: Tokyo, Japan
Contact:

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

Post 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
--
Benjamin L. Russell / DekuDekuplex at Yahoo dot com
http://dekudekuplex.wordpress.com/
Translator/Interpreter / Mobile: +011 81 80-3603-6725
"Furuike ya, kawazu tobikomu mizu no oto."
-- Matsuo Basho^

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

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

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

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

cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

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

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

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

Locked