newLISP Fan Club

Forum => Anything else we might add? => Topic started by: DekuDekuplex on March 15, 2009, 10:46:29 PM

Title: question on the reason for the [cmd]/[/cmd] multi-line tags
Post by: DekuDekuplex on March 15, 2009, 10:46:29 PM
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 (//http), 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 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
Title:
Post by: Lutz on March 16, 2009, 05:17:40 AM
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.
Title:
Post by: Lutz on March 16, 2009, 06:50:18 AM
... 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.
Title:
Post by: cormullion on March 16, 2009, 10:02:41 AM
- 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.)
Title:
Post by: Lutz on March 16, 2009, 10:13:46 AM
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.