Search found 32 matches

by iNPRwANG
Wed Feb 29, 2012 12:31 am
Forum: newLISP in the real world
Topic: Debug feature bracket match error?
Replies: 4
Views: 2191

Debug feature bracket match error?

While run this code: (define (hello-world a) (letn ((tmp 10) (val1 (* tmp 2)) (val2 (* tmp 2))) ) ) (debug (hello-world 10)) (define (hello-world a) #(letn ((tmp 10) (val1 (* tmp 2)) (val2 (* tmp 2))))#) [-> 3 ] s|tep n|ext c|ont q|uit > s ----- (define (hello-world a) (letn ((tmp 10) (val1 #(* tmp ...
by iNPRwANG
Mon Dec 26, 2011 3:30 am
Forum: newLISP in the real world
Topic: Is there the name conflict of lambda in newlisp?
Replies: 11
Views: 5341

Re: Is there the name conflict of lambda in newlisp?

Here is a function you can use to define functions as default functors in their own space: (define (def-static s body) (def-new 'body (sym s s))) and use like this: > (def-static 'acc (fn (x) (inc sum x))) acc:acc > (acc 1) 1 > (acc 1) 2 > (acc 1) 3 > (acc 5) 8 > acc:acc (lambda (acc:x) (inc acc:su...
by iNPRwANG
Mon Dec 26, 2011 12:37 am
Forum: newLISP in the real world
Topic: Is there the name conflict of lambda in newlisp?
Replies: 11
Views: 5341

Re: Is there the name conflict of lambda in newlisp?

Thanks, this solution of define function as context default functor can avoid name conflict in most case. : )
by iNPRwANG
Sun Dec 25, 2011 7:42 am
Forum: newLISP in the real world
Topic: Is there the name conflict of lambda in newlisp?
Replies: 11
Views: 5341

Re: Is there the name conflict of lambda in newlisp?

Thanks a lot! I'v read the common lisp special, and I'v understand the newlisp uses the dynamic scope, the common lisp could use (declare (special xxx)) to let a variable's scope be dynamic. But, had newlisp got a solution to avoid the name conflict of dynamic scope? Such as, I often use the variabl...
by iNPRwANG
Sat Dec 24, 2011 8:10 am
Forum: newLISP in the real world
Topic: Is there the name conflict of lambda in newlisp?
Replies: 11
Views: 5341

Is there the name conflict of lambda in newlisp?

I'm sorry for my english. While I run under codes, I can not understand why the result is 10 unless the myfun's lambda parameter use the variable "a" defined of myfun2. And the common lisp get the right results :30. (define (myfun2 fun) (let ((a 20)) (apply fun '()) ) ) (define (myfun) (let ((a 10))...
by iNPRwANG
Sun Jun 12, 2011 2:50 am
Forum: newLISP and the O.S.
Topic: Run newlisp like multiple instance in one dll and debug in a
Replies: 2
Views: 2906

Re: Run newlisp like multiple instance in one dll and debug

Your AllocDebugConsole() function is a nice idea and I will add it into the next version of the newLISP DLL. I'm very glad to hear that. : ) Rather then running multiple instances of newLISP in the same DLL, I would run multiple instances of newlisp.exe and import Windows GUI functions using 'impor...
by iNPRwANG
Sat Jun 11, 2011 11:24 am
Forum: newLISP and the O.S.
Topic: Run newlisp like multiple instance in one dll and debug in a
Replies: 2
Views: 2906

Run newlisp like multiple instance in one dll and debug in a

Hi everyone! I'm a Chinese and with a little English : ) and this is my first post. I used newlisp period of time, I think it's a very good and easy to use script as a lisp language. One day, I want to use it in a Microsoft Windows GUI application, I use the export function "newlispEvalStr" to eval ...