YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

Missing documentation, or unintended feature?
peter
#1 Posted : Thursday, January 14, 2016 10:12:44 AM(UTC)
Rank: Member

Groups: Registered
Joined: 7/31/2012(UTC)
Posts: 24
Location: Cambridge, UK

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
In the Squirrel 3 documentation http://www.squirrel-lang.org/doc/squirrel3.html the syntax for function parameters

Quote:
f( a, b, c, d )


and for array initialisers

Quote:
a <- [ x, y, z ]


are defined in terms of "[explist]", which is itself not defined. It turns out that in both places, whitespace-separated as well as comma-separated lists are accepted. Is this intentional? If so it should probably be documented.

It's a bit confusing IMO, because

Quote:
sq>print([2 3].len())
2
sq>print([2 -3].len())
1


Peter
fagiano
#2 Posted : Thursday, January 14, 2016 4:21:03 PM(UTC)
Rank: Advanced Member

Groups: Registered, Administrators
Joined: 6/11/2005(UTC)
Posts: 1,054

Thanks: 0 times
Was thanked: 77 time(s) in 59 post(s)
It was an unintentional feature I'm aware of. I was wondering if it should be removed or documented. I more prone to remove it as it can cause involuntary behavior (as in your example). I wonder if fixing 3.0.x would break anybody's code.

Alberto
Follow me on Twitter @squirrellang
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Clean Slate theme by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.4 | YAF © 2003-2010, Yet Another Forum.NET
This page was generated in 0.127 seconds.