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 - genghis

#1
Quote from: "Kazimir Majorinc"How about this one for beginning:



(define-macro (my-inc p0)(set p0 (+ (eval p0) 1)))

The above fails with the following error when called through my sum function above:

ERR: symbol expected in function set : p0



What I'm interested is having a function/macro/fexpr that can modify its arguments in-place, exactly like what inc does: i.e., it works even with literal numbers. Is this possible or do built-ins like inc and dec can only be implemented by the underlaying newLISP C implementation?
#2
Let me clarify my question:



Is it possible to create my version of inc, my-inc?



(define (sum (x 0)) (my-inc 0 x))
(sum 1) ;=> 1
(sum 2) ;=> 3
sum ;=> (lambda ((x 0)) (my-inc 3 x))

My gut instinct tells me in order to have a self-modifying code like the above, my-inc must have a reference to the enclosing lambda list. How do I go about creating my-inc ? Is this possible?
#3
Whither newLISP? / In-place parameter substitution
April 12, 2012, 09:10:52 AM
Hi, is it possible to create a user-defined function much like what inc does: in-place parameter substitution, or is this only available for built-in functions?



Where do newLISPers hangout? Is there a #newlisp IRC channel somewhere?
#4
newLISP in the real world / Integer comparison bug
April 12, 2012, 09:03:35 AM
Loving the language so far.



(= 9223372036854775807 9223372036854775808)

The above returns true. Shouldn't it be nil instead? Where can I submit bug reports? Do we have an bug tracker?