Search found 11 matches

by eliben
Tue Dec 05, 2006 7:31 pm
Forum: Anything else we might add?
Topic: Returning closures
Replies: 7
Views: 6725

Returning closures

Hello, I'm trying to understand how to utilize the contexts of newlisp to implement various lexical bound idioms, for instance returning closures. Take this CL code for example: (defun make-multiplier (x) (lambda (y) (* x y)) make-multiplier is a generator of multiplier functions. It can generate as...
by eliben
Thu Apr 20, 2006 5:42 pm
Forum: newLISP newS
Topic: Macros and deficiencies from CL
Replies: 24
Views: 26343

It just feels a little clunky to me that this 'catch' should wrap a loop to enable us to exit from it. Perhaps 'dolist' can be expanded by means of a macro to enable a more structured way to exit from a loop. I know. I felt the same way when I found out that 'return' in CL works by the fact that al...
by eliben
Thu Apr 20, 2006 5:10 pm
Forum: newLISP newS
Topic: Macros and deficiencies from CL
Replies: 24
Views: 26343

So, the common idiom in newlisp for returning (breaking) in the middle of the loop is by using the exception ? I like to think of 'catch/throw' as non-local exiting (i.e. I treat it in this more generic sense as a programming construct). Non-local exits can be used (are most often used?) for except...
by eliben
Thu Apr 20, 2006 5:05 pm
Forum: newLISP newS
Topic: Article about newlisp vs. other lisps
Replies: 2
Views: 4096

Comments and discussion are beginning to pile up on both the blog and comp.lang.lisp

I strongly encourage newlisp enthusiasts to participate. In my opinion it can be a great learning experience for us all - using comparisons is a great way to learn.
by eliben
Thu Apr 20, 2006 4:43 pm
Forum: newLISP newS
Topic: Macros and deficiencies from CL
Replies: 24
Views: 26343

rickyboy wrote:
Is there no way to achieve this without catch / throw ?
Yes, there is a way: with recursion, my good man, with recursion. :-)
So, the common idiom in newlisp for returning (breaking) in the middle of the loop is by using the exception ?
by eliben
Thu Apr 20, 2006 4:32 pm
Forum: newLISP newS
Topic: Macros and deficiencies from CL
Replies: 24
Views: 26343

Yes, here is another similar 'lazy' evaluating version (also written as a macro): (define-macro (my-and) (catch (dolist (i (args)) (if (not (eval i)) (throw nil) true)))) now only tested elements up to the thrown are evaluated Lutz Is there no way to achieve this without catch / throw ?
by eliben
Thu Apr 20, 2006 3:25 pm
Forum: newLISP newS
Topic: Article about newlisp vs. other lisps
Replies: 2
Views: 4096

Article about newlisp vs. other lisps

Hi,

I have posted an article about my impression of newlisp:
http://eli.thegreenplace.net/2006/04/20 ... t-of-lisp/

Comments from the newlisp point of view are more than welcome.
Eli
by eliben
Thu Apr 20, 2006 2:09 pm
Forum: newLISP newS
Topic: Macros and deficiencies from CL
Replies: 24
Views: 26343

Lutz, Thanks for the very informative post - this is exactly what I was looking for. I want to address a few points: 1) I agree that the division between "wanting to evaluate all arguments" and "not wanting to evaluate some of the argumetns" is logical regarding usage of macros, in most cases. Howev...
by eliben
Thu Apr 20, 2006 11:32 am
Forum: newLISP newS
Topic: Macros and deficiencies from CL
Replies: 24
Views: 26343

Are newlisp macros evaluated at "compile time" - like CL macros (and C "macros", for that matter) ? This is important for performance, of course. No, since there is no compiling with newLISP. So everything in newLISP is interpreted. In CL you can save your modified image to file and gets your own m...
by eliben
Thu Apr 20, 2006 4:24 am
Forum: newLISP newS
Topic: Macros and deficiencies from CL
Replies: 24
Views: 26343

Welcome to the group Eliben! Macros and many other things are quite different from Common LISP or SCHEME. Most code except for very simple examples from books about LISP will not run under newLISP. To find out more about the differences from newLISP to Common LISP and SCHEME see the following page:...
by eliben
Wed Apr 19, 2006 9:02 pm
Forum: newLISP newS
Topic: Macros and deficiencies from CL
Replies: 24
Views: 26343

Macros and deficiencies from CL

Hello, I have a couple of questions, one of which is probably controversial. I want to note first that I'm here out of sheer curiosity as newLisp looks interesting. I come from a Perl / Ruby / C++ background with some knowledge and experience in Common Lisp. My intention is not flame, but rather a s...