We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 31a823e commit 80fb6c8Copy full SHA for 80fb6c8
app/server/ruby/lib/sonicpi/lang/core.rb
@@ -2751,7 +2751,9 @@ def define(name, &block)
2751
raise ArgumentError, "A function called #{name} is already part of Sonic Pi's core API. Please choose another name."
2752
end
2753
2754
- raise ArgumentError, "Function names can't start with a capital letter." if name.to_s =~ /^[A-Z]/
+ if block.arity == 0 && name.to_s =~ /^[A-Z]/
2755
+ raise ArgumentError, "Functions with no required parameters can't start with a capital letter."
2756
+ end
2757
2758
if already_defined
2759
__info "Redefining fn #{name.inspect}"
0 commit comments