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

Started by DekuDekuplex, March 15, 2009, 10:46:29 PM

Previous topic - Next topic

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 http://groups.google.com/group/comp.lang.lisp/msg/d3ed34f9a7b5b7e5">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.:


QuoteThere 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">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/\">http://dekudekuplex.wordpress.com/

Translator/Interpreter / Mobile:  +011 81 80-3603-6725

\"Furuike ya, kawazu tobikomu mizu no oto.\"

-- Matsuo Basho^

Lutz

#1
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

#2
... 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">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

#3
- 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

#4
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.