Closed srgx closed 2 months ago
I don't know if this helps much, but for a bit more context, the second issue seems to be limited to primitives:
cyclone> (define (kons a b) (cons a b))
ok
cyclone> (apply kons '(5 (1 2 3)))
(5 1 2 3)
Good find, thanks for the report @srgx!
Added debug output and see the following.
Why is analyze
called again after analyze-quoted
? Need to investigate further...
cyclone> (display (apply cons '(5 (1 2 3)))) (newline)
/* (analyze (display (apply cons (quote (5 (1 2 3)))))) */
/* (analyze display) */
/* (analyze (apply cons (quote (5 (1 2 3))))) */
/* (analyze apply) */
/* (analyze cons) */
/* (analyze (quote (5 (1 2 3)))) */
/* (analyze-quoted (quote (5 (1 2 3)))) */
/* (analyze (<primitive cons> 5 (1 2 3))) */
/* (analyze <primitive cons>) */
/* (analyze 5) */
/* (analyze (1 2 3)) */
/* (analyze 1) */
/* (analyze 2) */
/* (analyze 3) */Error: Unknown procedure type -- EXECUTE-APPLICATION: 1
cyclone>
/* (analyze (newline)) */
/* (analyze newline) */
and alternatively:
cyclone> (define (kons a b) (cons a b))
cyclone> (apply kons '(5 (1 2)))
/* (analyze (apply kons (quote (5 (1 2))))) */
/* (analyze apply) */
/* (analyze kons) */
/* (analyze (quote (5 (1 2)))) */
/* (analyze-quoted (quote (5 (1 2)))) */
/* (analyze ((procedure (a b) ...) 5 (quote (1 2)))) */
/* (analyze (procedure (a b) ...)) */
/* (analyze 5) */
/* (analyze (quote (1 2))) */
/* (analyze-quoted (quote (1 2))) */
Possible fix above, need to vet more and possibly clean up associated code. Also need to add some unit tests for this case before wrapping everything up.
We are good to go on this, closing.
Function 'apply' is not working properly in icyc