I’ve been using the syntax for defining functions in the tutorial e.g.
define :foo do |x,y|
x+y
end
Looking at the Ruby, the syntax is more what I would have expected…
def foo (x,y)
x+y
end
Which also works in SPi. I just wanted to understand the thinking behind this - is it to present a unified SPi syntax for education for instance? Or are they functionally different?
I can stick to the documented SPi syntax for this one. Sam has said ‘Sonic Pi is not Ruby’ so fair enough but I’m getting the point where using Ruby constructs is important. What’s the team view on this kind of thing?
I was looking at this because I wondered if the different ways of call a function where SPi or Ruby…
a=foo(1,2)
vs the more Rubyesque
a=(foo 1,2)