Skip to content

Commit f890efd

Browse files
committed
Spider - tweak function starting letter warning
Always raise a warning when a newly defined function starts with a capital letter and tweak message.
1 parent c36a588 commit f890efd

File tree

1 file changed

+2
-2
lines changed
  • app/server/ruby/lib/sonicpi/lang

1 file changed

+2
-2
lines changed

app/server/ruby/lib/sonicpi/lang/core.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2751,8 +2751,8 @@ def define(name, &block)
27512751
raise ArgumentError, "A function called #{name} is already part of Sonic Pi's core API. Please choose another name."
27522752
end
27532753

2754-
if block.arity == 0 && name.to_s =~ /^[A-Z]/
2755-
__delayed_warning "Functions with no required parameters shouldn't start with a capital letter."
2754+
if name.to_s =~ /^[A-Z]/
2755+
__delayed_warning "Warning - defined function '#{name}' starts with a capital letter and may not behave as expected. Please start functions with a lower-case letter."
27562756
end
27572757

27582758
if already_defined

0 commit comments

Comments
 (0)