Hi all,

So I'm working on a "not exactly" matlab (or octave) extension language for 
Guile.
One useful feature of matlab is that it has simple syntax for expressing 
matrices.
I am trying to use the following constraints for "[" ... "]".  What do you 
think?
1) a sequence of comma-separated scalar integers => Scheme vector of integers
   (This might be used for matrix indices)
2) otherwise, everything between "[" and "]" => typed-array of f64

scheme@(guile-user)> ,L nx-matlab
Happy hacking with nx-matlab!  To switch back, type `,L scheme'.

nx-matlab@(guile-user)> a = [1 , 2, 3];

nx-matlab@(guile-user)> ,L scheme
Happy hacking with Scheme!  To switch back, type `,L nx-matlab'.

scheme@(guile-user)> (vector-ref a 0)
$3 = 1


scheme@(guile-user)> ,L nx-matlab
Happy hacking with nx-matlab!  To switch back, type `,L scheme'.

nx-matlab@(guile-user)> b = [ 1.0, 2.0, 3.0; 4.0, 5.0, 6.0];

nx-matlab@(guile-user)> ,L scheme
Happy hacking with Scheme!  To switch back, type `,L nx-matlab'.

scheme@(guile-user)> (array-ref b 1 2)
$1 = 6.0


Reply via email to