Initialize int variable in declaration
arunisaac opened this issue · comments
Hi,
I would like to initialize an int variable in its declaration, like int n = 1
. Currently, I can only do this with two forms---a declare and a set---like so
(declare n int)
(set n 1)
Is there some way to do this with just a declare form---something like (declare n (int 1))
?
Thanks!
hi,
yes, there is a way - with define
.
(define n int 1)
Thanks, I somehow missed that in the documentation. I also just found let*
which is useful in some other occasions.
Cheers!