Deprecate words 'Dim', 'NewList', 'NewMap'
- Psychophanta
- Always Here
- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
Deprecate words 'Dim', 'NewList', 'NewMap'
Deprecate words 'Dim', 'NewList', 'NewMap' and use just 'Array', 'List' and 'Map' respectively instead.
Re: Deprecate words 'Dim', 'NewList', 'NewMap'
I like your suggestion. It would bring a little more consistency to the syntax. +1
Using Ubuntu 14.04 x64, Intel4700HD Graphics, 16GB RAM
Re: Deprecate words 'Dim', 'NewList', 'NewMap'
Dim fill a Array (global or structure) with null, and we have a ReDim to expand the array. You will rename it to ReArray?
NewList and NewMap creates new lists or maps.
Array, List and Map don't create it directly, it will use only in procedure parameters or in structes.
So I think the different names are right!
NewList and NewMap creates new lists or maps.
Array, List and Map don't create it directly, it will use only in procedure parameters or in structes.
So I think the different names are right!
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
-
- Addict
- Posts: 4777
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: Deprecate words 'Dim', 'NewList', 'NewMap'
+1STARGÅTE wrote:So I think the different names are right!
- Michael Vogel
- Addict
- Posts: 2797
- Joined: Thu Feb 09, 2006 11:27 pm
- Contact:
Re: Deprecate words 'Dim', 'NewList', 'NewMap'
What about a new dim called NewDim (or NewArray) then? Next step would RedimArray, of course 
Not easy to get a consistent catalouge of function names - as a result, I sometimes need to check the help file to find some rarely used function names, because I forgot, if it was CountListSize or ListCount or ListSize, or even ListItems?

Not easy to get a consistent catalouge of function names - as a result, I sometimes need to check the help file to find some rarely used function names, because I forgot, if it was CountListSize or ListCount or ListSize, or even ListItems?
Re: Deprecate words 'Dim', 'NewList', 'NewMap'
Why not just let it as it is?
It works - it's BASIC - and Hundreds and Thousands of usermade Functions are programmed with it!
Shall we always change our Software because someone has a new idea?
Adding stuff is good - changing it is bad in most cases - especially if it is used since "centuries"
Especially removing Dim from Basic would be a scandal ... unthinkable ... used it since Commodore PET 2032 ... and that was in 1978
.
It works - it's BASIC - and Hundreds and Thousands of usermade Functions are programmed with it!
Shall we always change our Software because someone has a new idea?
Adding stuff is good - changing it is bad in most cases - especially if it is used since "centuries"

Especially removing Dim from Basic would be a scandal ... unthinkable ... used it since Commodore PET 2032 ... and that was in 1978

.
--------------
Yes, its an Irish Wolfhound.
Height: 107 cm; Weight: 88 kg
Yes, its an Irish Wolfhound.
Height: 107 cm; Weight: 88 kg
-
- Enthusiast
- Posts: 542
- Joined: Tue Apr 24, 2012 5:08 pm
- Location: Ontario, Canada
Re: Deprecate words 'Dim', 'NewList', 'NewMap'
+9999999Thade wrote:Why not just let it as it is?

For ten years Caesar ruled with an iron hand, then with a wooden foot, and finally with a piece of string.
~ Spike Milligan
~ Spike Milligan
- Psychophanta
- Always Here
- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
Re: Deprecate words 'Dim', 'NewList', 'NewMap'
+1Michael Vogel wrote:What about a new dim called NewDim (or NewArray) then? Next step would RedimArray, of course
Not easy to get a consistent catalouge of function names - as a result, I sometimes need to check the help file to find some rarely used function names, because I forgot, if it was CountListSize or ListCount or ListSize, or even ListItems?
Re: Deprecate words 'Dim', 'NewList', 'NewMap'
I just had the same idea. At least for NewList and NewMap renaming to just List and Map makes sense for me. The New prefix is not really required, and without it is similar when using them inside a structure.
PB 5.70 LTS (x64) - Debian Testing, Gnome 3.30.2
Re: Deprecate words 'Dim', 'NewList', 'NewMap'
More like 1964!Thade wrote:...removing Dim from Basic would be a scandal ... unthinkable ... used it since Commodore PET 2032 ... and that was in 1978
BASIC Commands - THE ORIGINAL-ORIGINAL VERSION
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel 

Re: Deprecate words 'Dim', 'NewList', 'NewMap'
STARGÅTE wrote: So I think the different names are right!
+ 10^48Thade wrote: Why not just let it as it is?

I think changes in the syntax should be the absolute exception and require very good reasons.
Stanley decided to go to the meeting room...
Re: Deprecate words 'Dim', 'NewList', 'NewMap'
The PET was available in Germany in 1978TI-994A wrote:More like 1964!Thade wrote:...removing Dim from Basic would be a scandal ... unthinkable ... used it since Commodore PET 2032 ... and that was in 1978

And I do not think it was 1964 elsewhere in the world ...
In 1964 The Beatles were #1 to #5 in the US Charts ... I don't know how many people used home computers these days. But I bet it were less than 1
The first programmable calculator with magnet strips to save code I had was in 1976 or so ... a TI-59
Using a PET in 1964 shows that you must come from a parallel universe ... please tell us more about it

BTW: In 1983 I had also a TI-99 4A and published a game ... hmm ... have to look up the name ...
--------------
Yes, its an Irish Wolfhound.
Height: 107 cm; Weight: 88 kg
Yes, its an Irish Wolfhound.
Height: 107 cm; Weight: 88 kg
Re: Deprecate words 'Dim', 'NewList', 'NewMap'
Since my post was referring to the BASIC Dim statement, it seems that you're the one living in the parallel universe.Thade wrote:Using a PET in 1964 shows that you must come from a parallel universe ...

Me too. I did a version of Space Invaders and Cluedo. Come to think of it, having had to save all the hours of typing onto cassette tape, my trusty old TI-994A never crashed on me. That's good engineering.Thade wrote:BTW: In 1983 I had also a TI-99 4A and published a game ...

Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel 

Re: Deprecate words 'Dim', 'NewList', 'NewMap'
Me likes this idea too. But I suspect, Fred visits "Feature Requests and Wishlists" just once a year and picks up a random oneuwekel wrote:I just had the same idea. At least for NewList and NewMap renaming to just List and Map makes sense for me. The New prefix is not really required, and without it is similar when using them inside a structure.

Re: Deprecate words 'Dim', 'NewList', 'NewMap'
Playing devils advocateSTARGÅTE wrote:NewList and NewMap creates new lists or maps.
Array, List and Map don't create it directly, it will use only in procedure parameters or in structs.

Protected TestVar.Newi
The reality is that having the keyword within a Structure or Procedure declaration makes the language unambiguous.
I find this request totally logical. I have requested a similar "standardizing" of the syntax consistency, to expand the PeekS and PokeS format to include a new ReadS, instead of Read.s.
http://purebasic.fr/english/viewtopic.php?f=3&t=59865
With this current request, most of the votes for "Don't change" are because people do not want to update old code. However, Fred is very good at depreciating commands without immediately eliminating them...but even so, only the simplest of 4.x code works in a current compiler without edits. Heck, even 5.2 (?) forces an update if code contains pointer typing.
IMHO, this will be an exceptionally easy port; a mere search/replace. It will not significantly help current experienced users. (Although I, myself, just an average guy with several MB of code, still just automatically type List for everything and fix the syntax errors where NewList is required.) However, this Wish will advance the simplicity of PB, reducing its quirks, and make it even easier for newbies.
I am +1.