Skip to content

Scheme+ for Racket v8.5

Compare
Choose a tag to compare
@damien-mattei damien-mattei released this 21 Apr 08:54
· 15 commits to main since this release

Scheme+ for Racket v8.5

Special Racket edition:

there is no more need to define a variable , the first time the variable is assigned a value the variable is automatically defined !

works only with racket !

example: {x <- 7}

will define x and assign 7 to x

the variable is locally defined in the lexical field of the block, example if you define a variable in a for-next loop the variable can be used in the loop but not after (not like Python but almost) so if you need the variable after you must declare it before the loop ( <+ , define, declare, let ,etc) or just put the <- before the block you need the variable and after.

Other new features:

multiple values can be used to assign a Tuple of variables like in Python:

{(a b c d e) <- (values 1 2 3 4 5)}

(list a b c d e)
'(1 2 3 4 5)

works even with indexed by [ ] structures (vectors, arrays,....) :

(define T (make-vector 5))
{(a T[3] c d e) <- (values 1 -2 3 4 5)}

{list(a T[3] c d e)}
'(1 -2 3 4 5)
T
'#(0 0 0 -2 0)