Menu

Show posts

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

Topics - gatesphere

#1
Hi all,



Wondering if there's an equivalent to flet or labels in newLISP.  I don't see any in the docs.  There might be a way to hack it together with letex and lambda, but I'm not sure.



Any help?



Thanks.
#2
Hello all,



I've been playing around with newLISP on my Raspberry Pi, and I whipped up a quick library to interface with the GPIO pins.



It's available here in case anyone's interested: https://github.com/gatesphere/raspi-gpio-newlisp">https://github.com/gatesphere/raspi-gpio-newlisp



Man this language is sexy.
#3
Hello all...



So I came across this example function in the Code Patterns guide.  I'm new to newlisp, so this code is confusing me.  How does this function have memory?


(define (sum (x 0)) (inc 0 x))

I understand that (x 0) means that 0 is a default value for x, what I'm not understanding is why does sum rewrite itself?



I've traced it, and found that after a (sum 4), sum => (lambda ((x 0)) (inc 4 x))...  this confuses me.



Any help?  Thanks.