Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Suggestion about the functions and the brackets
#1
I suggest to always use brackets with functions, both in the Syntax and Examples sections, and everywhere in the docs.

I suggest to include a note in the language reference page in order to explain that brackets are optional in functions for the sake of compatibility with Sinclair BASIC (and maybe FreeBASIC in some cases). But that's all.

I think the code is much more clear with brackets; they help to avoid bugs too. And it's the standard beside a good practice, isn't it? On the other hand, it's good to have a clear convention to write the docs.
Reply
#2
programandala.net Wrote:I suggest to always use brackets with functions, both in the Syntax and Examples sections, and everywhere in the docs.

I disagree. This would break compatibility with Sinclair Basic.

programandala.net Wrote:I suggest to include a note in the language reference page in order to explain that brackets are optional in functions for the sake of compatibility with Sinclair BASIC (and maybe FreeBASIC in some cases). But that's all.

I think the code is much more clear with brackets; they help to avoid bugs too. And it's the standard beside a good practice, isn't it? On the other hand, it's good to have a clear convention to write the docs.


Wait, now you're saying you don't want to require it at all? Perhaps I'm misreading it - you're saying to always allow brackets, for things like RND? I suppose there's no reason not to allow RND() - and I think Boriel has updated the function to allow that; but since it never takes any parameters I don't think it matters. It behaves just like PI in most respects - it replaces a number.
Reply
#3
britlion Wrote:
programandala.net Wrote:I suggest to always use brackets with functions, both in the Syntax and Examples sections, and everywhere in the docs.

I disagree. This would break compatibility with Sinclair Basic.

I'm afraid you misinterpreted. I'm talking about the docs, not the compiler.
Reply
#4
programandala.net Wrote:
britlion Wrote:
programandala.net Wrote:I suggest to always use brackets with functions, both in the Syntax and Examples sections, and everywhere in the docs.

I disagree. This would break compatibility with Sinclair Basic.
I'm afraid you misinterpreted. I'm talking about the docs, not the compiler.
It's okay with ZX BASIC. The compiler already allows both forms (with and without parenthesis). This week end I will upload a new version. But need to fix 2 important bugs with strings first. :wink:
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)