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

Messages - sponsy

#1
I bought into the idea of newLISP for scripting a few weeks ago and love it. I decided to tackle some project euler problems using newLISP, primarily so that I can learn the syntax and get familiar with the API.



That said, I won't purport that any of the solutions are optimal; only that they are beautifully terse. Experienced newLISPers will be quick to point out how horrible I might've done something, but this was a means to an end of learning the language. Repo for some solved problems here:



https://github.com/sponsy/project-euler-newlisp">https://github.com/sponsy/project-euler-newlisp
#2
Excellent, thanks! My eyes seemed to have skipped over that after bouncing around the wiki so frequently the last few days.
#3
Hi :) I'm pretty new to newlisp, but I'm loving it so far for its quick scripting abilities-- I want to see if it can outdo Python for terseness.



What I can't seem to find an answer to: I want to execute multiple expressions within an if-statement branch without defining a separate function. So, when the if-statement below evaluates to true, I want to push the value 10 onto the list x, and in the same breath clear the list y (without defining separate function).



(set 'x '())
(set 'y '(1 2 3))

(if
    (nil?) (push 10 x)) ; how can I also clear y here? (evaluate multiple expressions)


Probably an ignorant question, but I'm struggling to find a better way. Thanks!