* matlab extension for entering matrices in Guile
@ 2018-08-17 16:03 Matt Wette
2018-08-19 21:29 ` Joshua Branson
0 siblings, 1 reply; 2+ messages in thread
From: Matt Wette @ 2018-08-17 16:03 UTC (permalink / raw)
To: guile-user
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-08-19 21:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-17 16:03 matlab extension for entering matrices in Guile Matt Wette
2018-08-19 21:29 ` Joshua Branson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).