[CM] CM compositions on web

Heinrich Taube taube at uiuc.edu
Wed Jan 20 14:21:13 PST 2010

On Jan 10, 2010, at 9:02 AM, Johannes Quint wrote:

>> im toying with the
>> idea of version of sal that simply provides infix expressions without
>> the structure of 'commands'.
> good idea. they are - among others - the reason why i turned away from
> sal back to scheme.
> it also would be great to have optional arguments and rests for
> function-definitions in sal.

i forgot to mention that in the last beta apps i saved,  sal function  
parameters are now opt/key -- similar to how definstrument or  
supercollider functions work.  you assign default values to parameters  
like any variable binding, ie

define function hiho (a = 1,  b )
  return list(a,b)

print hiho()
{1 #f}

print hiho(4,5)
{4 5}

print hiho(b: 44)
{#f 44}

to get a &rest arg  you can append ... to the last parmeters name

define function hiho (args...)
  return args

print hiho(1,2,3,4,5)
{1 2 3 4 5}

internally i simply switched from define to s7's define*
this should be completely backward compatible since only required was  
supported until now.

at some point this year i will have a functional version of sal  
(sal2), but im taking a break after this upcoming release to write  
some music!

More information about the Cmdist mailing list