This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu
> (define (build-sym x) (sym (string 'C x)))
(lambda (x) (sym (string 'C x)))
> (context (build-sym 2))
C2
C2> (context MAIN)
MAIN
> (context? (build-sym 2))
nil
> (context? (eval (build-sym 2)))
true
> (context (build-sym 2))
C2
C2>
C2> (context MAIN)
MAIN
> (setq ctx (build-sym 2))
C2
> (symbol? ctx)
true
> (context? ctx)
nil
> (setq cty C2)
C2
> (symbol? cty)
nil
> (context? cty)
true
>ctx
C2
>(symbols)
... ? @ C2 MAIN NaN? ...
> (set ctx "something else")
symbol is protected in function set : C2
> (context ctx)
C2
C2>
The unlambda language:Quote from: "newdep"http://www.madore.org/~david/programs/unlambda/">http://www.madore.org/~david/programs/unlambda/
Quote from: "newdep"
Is 'max quicker on a sorted or unsorted list ;-)
> (time (sort c))
183
> (last c)
3549
> (time ((push max c) (eval c)))
27
Quote from: "HPW"
...shorter.
> (setq c (flat (dup b 1000)))
....35 51 34
> (time (apply max c))
49
> (time ((push max c) (eval c)))
23
> (pop c)
max <C42C>
> (time (apply max c))
48
Quote from: "Dmi"
Note about the last NCR:x symbol. Where is it from?
I think it must not be present... Or I have a mistake somewhere?
Quote from: "pjot"
I also thought to 'do something with sym', and I see your solution points in this direction. But you're using the 'cons' statement, which I never used myself before;
(define (merge lst1 lst2) (map cons lst1 lst2))
(setq XYZ '(X Y Z))
(setq xyz '(156 209 3))
(context (sym (join (map string (flat (merge XYZ xyz))))))
X156Y209Z3
X156Y209Z3>
Honestly... Concept of this game isn't mine. I played one that has 5x5 field. I couldn't solve it (only by accident), so I decided to make my own version where I can better see the field and can think about it more :-)Quote from: "Fanda"
Later on, I added more levels ;-)
Fanda
Quote from: "pjot"
So every time when I print the address of an array member, the address changes....?!?!
Peter
(setq indx 0)
(inc indx)
(push (cons ((sym (append (string (i (indx))))) (sym (adress (sym (append (string (i (indx))))))) alst -1)
"alst" would then be: ((i1 address) (i2 address) ... )
> (define (myProc) (println "hi"))
(lambda () (println "hi"))
> (def-new 'myProc 'myCtx:myCtx)
myCtx:myCtx
> (myCtx:myCtx)
hi
"hi"
> (context? myCtx)
true
> myCtx:myCtx
(lambda () (println "hi"))
> (set 'myVar 'myCtx2:myCtx2)
myCtx2:myCtx2
> (def-new 'myProc myVar)
myCtx2:myCtx2
> (context myCtx2)
myCtx2
myCtx2> (myCtx2)
hi
"hi"
> (set 'myVar (sym (append "myCtx" (string 3) ":myCtx" (string 3))))
myCtx3:myCtx3
> (def-new 'myProc myVar)
myCtx3:myCtx3
> (context? myCtx3)
nil
> myCtx3:myCtx3
context expected : myCtx3
Regarding an implicit 'if': I have been going back and forth on this in my mind, I am just not sure if I want it, if it leads to too much ambiguities from a users point of view? When the first expression evaluates to 'nil' things are clear, but what if the the xpression evauates to a list or number? Is it now impicit indexing or impixit 'if' etc.Quote from: "Lutz"
Taken from a debate in the #newlisp channel on freenode, here was this guy's complaints/arguments:Quote from: "statik"
<someguy> well, newlisp's memory manager really sucks
<someguy> because it doesn't handle shared structure
Quote
<someguy> it copies objects when you pass parameters
<someguy> because its inefficient
<someguy> also it means you can't have first-class arrays or hash tables
Quote
<someguy> you have to name all arrays and hashes by symbols, and pass symbols, you can't just pass an anonymous hash
<someguy> it severely limits the language
Quote
<someguy> performance?
<someguy> sbcl is much faster
<someguy> except the design of newlisp is quite poor
<someguy> and i noticed the flawed memory management,
Quote
and lack of first-class arrays and hashes
Quote
<someguy> more problems in newlisp than high-quality common lisps like sbcl
<someguy> in fact, i don't see anything newlisp is good for
Quote
<someguy> i've also looked at the implementation code, its a mess
<someguy> in that sbcl is better in every way
<someguy> it has first class arrays, hashes, real gc, a better object system
<someguy> newlisp is a strict subset of common lisp, except the really broken parts (copying all values when passing parameters, 'contexts')
Quote
<someguy> also there's no number tower
<someguy> so integer math overflows
<someguy> that's really bad
<someguy> you can have a file larger than 2gb, but newlisp cannot represent its size
<someguy> algorithms like md5 and sha1 hashing, and rsa crypto all use bignums
Quote
I could argue all day with this guy
Hi newLispers,Quote from: "pjot"
With the GTK-server it is possible to create a drawing on a canvas. I made a demonstration here: ...
Hi newLispers,Quote from: "pjot"
With the GTK-server it is possible to create a drawing on a canvas. I made a demonstration here: ...