How many ways can one define arguments for a function?

In my work with the sclang tree-sitter grammar I have had to sit down and write syntactic rules / specs for sclang. This is a really fun exercise but it also makes me laugh out loud sometimes that I stumble on language features I had NEVER seen or heard of before - for example that you can define parameters with no commas in between list items if you use | for defining arguments or you can initialize parameters with parenthesis. Or that things like (:1..) select: _.isPrime nextN: 10; are actually fully valid expressions in sclang.

Anyways, I am curious if I have missed anything with regards to defining arguments in functions with and without initialization? See below

// No parameter init
{|a,b| (a+b).postln}.value(1,2)
{arg a,b; (a+b).postln}.value(1,2)

// No commas in between!?
{|a b| (a+b).postln}.value(1,2)

// With parameter initialization
{|a=1, b=2| (a+b).postln }.value
{|a(1), b(2)| (a+b).postln }.value

{arg a(1), b(2); (a+b).postln }.value
{arg a=1, b=2; (a+b).postln }.value

with param initialization no commas!

{|a=1 b=2| (a+b).postln}.value
{|a(1) b(2)| (a+b).postln}.value

|x 6 y 7 z 8| is true

who knew! that is the least typing for sure

Yeah I gotta hand it to one of the devs, who recently pointed out a few things among others…

Still, the documentation could be a little more organized, as far as keeping centralized sources that serve to explicity cite all existing forms of a certain alternative syntax implementation.

However… SC is the only place where the esoteric and ineffable actually add to the effect, in certain places… such as an abstract stream of lyrics, fragmented & enigmatic… one can still feel the depth beyond all that cannot be fully understood, and this adds a certain quality to the work, especially when this is paired with the musical result, it invokes a certain feeling… rare and profound is when the complexity and impossible add to such an experience, one quite rare and exclusive to SC .

Certain gems are buried in the documentation, elusive and rare, esoteric to a heavy extent, and if this is the exchange, for a rare form of experience that challenges clarity, exchanging it for levels deep of expressive complexity, I couldn’t say that everything isn’t how it should be, or that anything with any urgency must be changed…

Godspeed to all the devs here. Mad props, levels respect.

2 Likes