(define (name, local-decalre) ..) would lost (args)

For the Compleat Fan
Post Reply
ssqq
Posts: 88
Joined: Sun May 04, 2014 12:49 pm

(define (name, local-decalre) ..) would lost (args)

Post by ssqq »

Code: Select all

> (define (show-args) (println (args)))             
(lambda () (println (args)))                        
> (show-args 1 2 3)                                 
(1 2 3)                                             
(1 2 3)                                             
> (define (show-args,@x) (println (args)))          
(lambda (, @x) (println (args)))                    
> (show-args 1 2 3)                                 
(3)                                                 
(3)                                                 
> (define (show-args @x, @y) (println @x (args)))   
(lambda (@x , @y) (println @x (args)))              
> (show-args 1 2 3)                                 
1()                                                 
()                                                  
>

ssqq
Posts: 88
Joined: Sun May 04, 2014 12:49 pm

Re: (define (name, local-decalre) ..) would lost (args)

Post by ssqq »

I think newlisp treat `,` and follow args as extra args, so assign them with nil in default and init in *args stack*.

Post Reply