Page 2 of 2
Re: Deprecate words 'Dim', 'NewList', 'NewMap'
Posted: Sat Nov 01, 2014 2:59 pm
by Derren
The only thing I'd want to change is that you have to give a dimension to an Array in procedure. Since the array is provided from an external source it doesn't make sense to pre-dim the Array.
Not exactly related to this topic, though.
Re: Deprecate words 'Dim', 'NewList', 'NewMap'
Posted: Sat Nov 01, 2014 3:02 pm
by heartbone
gavindi wrote:I like your suggestion. It would bring a little more consistency to the syntax. +1
Not at all. Without an extensive redo of the documentation it would be much more confusing to beginners.
The documentation already has:
Chapter 93
Array
and
93.1
ArraySize
Syntax
Result = ArraySize ( Array () [ , Dimension ])
If you were to rename it, then
DimensionArray() and
RedimensionArray()
would make far more sense than the previous suggestion.
Leave it alone or change
EllapsedMilliseconds() to
RetrieveCurrentTimerValue()
Because in my code the elapsed milliseconds actually has to be calculated from the returned value of
EllapsedMilliseconds().
If it ain't broke...
Derren wrote:The only thing I'd want to change is that you have to give a dimension to an Array in procedure. Since the array is provided from an external source it doesn't make sense to pre-dim the Array.
Good idea.
Re: Deprecate words 'Dim', 'NewList', 'NewMap'
Posted: Sat Nov 01, 2014 3:46 pm
by Derren
Apropos documentation...
When I hit F1 on "Array" I am directed to the Array help page where I have to find Array manually. This is true for a few keywords that are bunched up together on a single page. I don't know if chm files support anchors, else single subpages or at least a clickable link index on top of each page would be a good idea...
Re: Deprecate words 'Dim', 'NewList', 'NewMap'
Posted: Sat Nov 01, 2014 6:50 pm
by Psychophanta
The issue is that there are some prefixes, like 'Open' like OpenWindow(), 'Add', 'New', 'Create' like CreateSprite(), and perhaps this should be revised for more syntax consistence.
Re: Deprecate words 'Dim', 'NewList', 'NewMap'
Posted: Fri Nov 14, 2014 12:48 pm
by Opcode
Everything's fine the way it is, if it's not broken don't fix it.
Tho if any change at all.
- NewList => CreateList
- NewMap => CreateMap
Dim and ReDim were probably borrowed from Visual Basic. I personally don't see any reason for changing them.
Re: Deprecate words 'Dim', 'NewList', 'NewMap'
Posted: Fri Nov 14, 2014 4:34 pm
by Seymour Clufley
I agree with the OP.
It adds nothing, in terms of clarity or function, to have separate words for writing an array inside and outside a structure. With that in mind, why not just make things as simple as possible and use one word?
Re: Deprecate words 'Dim', 'NewList', 'NewMap'
Posted: Fri Nov 14, 2014 5:12 pm
by Derren
Seymour Clufley wrote:I agree with the OP.
It adds nothing, in terms of clarity or function, to have separate words for writing an array inside and outside a structure. With that in mind, why not just make things as simple as possible and use one word?
Why not have a more powerful pre-compiler?
This is possibly valid code in theory:
Code: Select all
Define foo.i(1)
foo(0)=20
foo(1)=30
Procedure bla(myArray())
ProcedureReturn myArray(0) + myArray(1)
EndProcedure
Debug bla(foo()) ;50
All these little tweaks don't seem to make sense to me. Either make one big change, or don't change anything at all.