It would be nice to support [] for arrays too, instead only ().
Using () for functions and maybe optional [] for arrays would make the source more readable and make clear if its a function or array.
Supporting [] for arrays, instead only ()
Supporting [] for arrays, instead only ()
va!n aka Thorsten
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
- Zebuddi123
- Enthusiast
- Posts: 796
- Joined: Wed Feb 01, 2012 3:30 pm
- Location: Nottinghamshire UK
- Contact:
Re: Supporting [] for arrays, instead only ()
+1 But the problem of breaking backward compatibility
Zebuddi.

Zebuddi.

malleo, caput, bang. Ego, comprehendunt in tempore
Re: Supporting [] for arrays, instead only ()
but then it is not clear, if it is a static array (only []) or a dynamic array (with optional [])?
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Re: Supporting [] for arrays, instead only ()
That's why it could be an optional feature... People can choose to use () or [] for arrays.+1 But the problem of breaking backward compatibility![]()
Sure, using only [] for arrays would be smarter.
va!n aka Thorsten
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Re: Supporting [] for arrays, instead only ()
Having two ways to write the same code just adds confusion.
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: Supporting [] for arrays, instead only ()
I think it would have a place but only if functionality were added, where the new brackets would denote an associative array. Not sure we really need associative arrays in Purebasic as the map object covers most of it. The only gain would be a smaller memory footprint and more efficient code where the number of elements is small, something like less than 50.
BERESHEIT
Re: Supporting [] for arrays, instead only ()
Perhaps the IDE could allow a colour difference to distinguish Arrays from Functions?
DE AA EB