Bonjour,
i released Scheme+ for Racket v8.5, special Racket Edition
only compatible with Racket, using identifier-binding .
New features:
there is no more need to define a variable , the first time the variable is assigned a value the variable is automatically defined if not already binded!
works only with Racket ! (impossible to do the same in Guile or Kawa, even with exception handling,unless at runtime which is of no use in a macro context)
example:
(<- x 7) ; prefix notation
{x <- 7} ; curly infix notation
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 (can and will be compatible with all Scheme+ implementation):
multiple values can be used to assign a Tuple of variables like in Python, again, in Racket there will be no need to have the variables previously defined:
Welcome to DrRacket, version 8.12 [cs].
Language: reader "SRFI-105.rkt", with debugging; memory limit: 8192 MB.
{(a b c d e) <- (values 1 2 3 4 5)}
; or :
(<- (a b c d e) (values 1 2 3 4 5))
(list a b c d e)
'(1 2 3 4 5)
On demand it works also with this 'historical' operator :
{(a b c d e) := (values 1 2 3 4 5)}
{x := 7}
works even with indexed by [ ] structures (vectors, arrays,strings,hash tables....) :
Welcome to DrRacket, version 8.12 [cs].
Language: reader "SRFI-105.rkt", with debugging; memory limit: 8192 MB.
(define T (make-vector 5))
{(a T[3] c d e) <- (values 1 -2 3 4 5)} ; [ ] requires { } infix curly SRFI 105 notation
; or this notation in prefix:
(<- (a {T[3]} c d e) (values 1 -2 3 4 5))
{list(a T[3] c d e)} ; special notation of SRFI 105
'(1 -2 3 4 5)
T
'#(0 0 0 -2 0)
{(list a T[3] c d e)} ; for the Lisp purists
'(1 -2 3 4 5)
; or even more Lispy:
(list a {T[3]} c d e)
'(1 -2 3 4 5)
Bonne journΓ©e,
Damien
note: even while providing a curly-infix syntax, Scheme+ is 100% compatible with the traditional Scheme syntax.