FAQ  •  Register  •  Login

Suggestion about the functions and the brackets

<<

programandala.net

Posts: 98

Joined: Fri Apr 09, 2010 12:50 am

Location: España/Hispanujo/Spain

Post Fri Jun 18, 2010 4:52 pm

Suggestion about the functions and the brackets

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.
<<

britlion

Posts: 766

Joined: Mon Apr 27, 2009 7:26 pm

Location: Slough, Berkshire, UK

Post Fri Jun 18, 2010 5:07 pm

Re: Suggestion about the functions and the brackets

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.
<<

programandala.net

Posts: 98

Joined: Fri Apr 09, 2010 12:50 am

Location: España/Hispanujo/Spain

Post Fri Jun 18, 2010 5:38 pm

Re: Suggestion about the functions and the brackets

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.
<<

boriel

Site Admin

Posts: 1463

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Fri Jun 18, 2010 5:47 pm

Re: Suggestion about the functions and the brackets

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:

Return to Documentation

Who is online

Users browsing this forum: No registered users and 0 guests

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.

phpBB SEO