Re: while testing lists.sal in Grace 1.0.2

View: New views
2 Messages — Rating Filter:   Alert me  

Parent Message unknown Re: while testing lists.sal in Grace 1.0.2

by Heinrich Taube :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Else how does one pick out an element from a list in a given numeric  
> position?
> Is there a general reference for SAL?

you can do what you want two ways:


1. use scheme's list-ref (scheme doesnt have elt):

print list-ref( {q w e r t y}, 3)

2. use sal's [] indexing of variables:

begin
  with foo = {a b c d e}
  print foo[1]
end

the elt is the tutorial mistake  , ill fix it later this morning with  
the other nits.


On Aug 26, 2008, at 10:37 PM, Denis Fitzpatrick wrote:

> while testing lists.sal in Grace 1.0.2 OS X Leopard 10.5.4
>
> with:
> print elt(notes, 0)
> got:
> >>> Error: unbound variable: elt
>
> Else how does one pick out an element from a list in a given numeric  
> position?
> Is there a general reference for SAL?
>
> Thanks.   Grace good.
>
> Denis

_______________________________________________
Cmdist mailing list
Cmdist@...
http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist

Re: while testing lists.sal in Grace 1.0.2

by Heinrich Taube :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

sorry forgot to answer this

>> Is there a general reference for SAL?


doc/cm.doc is the reference for sal and scheme. entries are normally  
shown as sal syntax except in the (few) places were they differ in  
which case both scheme and sal syntaxes are shown.

cm.doc is availble in the Help menu or using this online link:

        http://camil.music.uiuc.edu/Software/grace/doc/cm.html




_______________________________________________
Cmdist mailing list
Cmdist@...
http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist
LightInTheBox - Buy quality products at wholesale price!