Need some help with closure using skill++. The below code loads fine in interactive mode but when I run it I get the error
E- *Error* eval: not a function-1. Not sure how to debug this, any help would be appreciated. I am using this from Allegro
did not see much of any reference to Skill++ there so I thought I would post here since it is a general Skill++ question.
It seems like it is counting (see the commands below the code).
Thanks,
Vince
(define (makecounters)
(let ((vcount 0))
(lambda ()
(setq( vcount (vcount + 1) ))
vcount)))
(define cntBy1 (makecounters))
Skill > load "test.ils"
variable makecounters redefined
t
ILS-<5>
Skill > cntBy1
ILS-<5>
E- *Error* eval: not a function - 1
Skill > cntBy1
ILS-<5>
E- *Error* eval: not a function - 2
Skill > cntBy1
ILS-<5>
E- *Error* eval: not a function - 3
Skill > cntBy1
ILS-<5>
E- *Error* eval: not a function - 4
Skill >