SC: Array and Hashtable/Hashmap/Dictionary
SC: Array and Hashtable/Hashmap/Dictionary
Hi Don,
don't know what new feature you're coming out next (besides diving deep into the forum's backlog).
But: is there any chance the SC will get support for some of these standard collection types?
Mimicking an array with a "|"-separated string is possible to a certain degree using gettoken(), and Sammay has provided his dict() implementation of such an in-memory ini-structure.
But frankly I really would prefer to have native support for these absolutely basic data types. All those "workarounds" stay, hmm, workarounds. Readability of more complex scripts is suffering heavily, and the visual elegance is lacking.
I don't know PHP (and the SC engine), so I can't estimate effort and complexity ("can of worms"). But I would be really, really happy.
Cheers,
Filehero
don't know what new feature you're coming out next (besides diving deep into the forum's backlog).
But: is there any chance the SC will get support for some of these standard collection types?
Mimicking an array with a "|"-separated string is possible to a certain degree using gettoken(), and Sammay has provided his dict() implementation of such an in-memory ini-structure.
But frankly I really would prefer to have native support for these absolutely basic data types. All those "workarounds" stay, hmm, workarounds. Readability of more complex scripts is suffering heavily, and the visual elegance is lacking.
I don't know PHP (and the SC engine), so I can't estimate effort and complexity ("can of worms"). But I would be really, really happy.
Cheers,
Filehero
Last edited by Filehero on 24 Sep 2016 09:23, edited 1 time in total.
Re: SC: Array and Hashtable/Hashmap/Dictionary
+1
One of my scripts helped you out? Please donate via Paypal
Re: SC: Array and Hashtable/Hashmap/Dictionary
+1
In special cases you may contact me on Discord: http://bit.ly/dsDisco
Re: SC: Array and Hashtable/Hashmap/Dictionary
You think of something like $a[$i1,$i2] or alike?
+1
+1
Win11 Pro 223H2 Gerrman
Re: SC: Array and Hashtable/Hashmap/Dictionary
Yes, nothing fancy.PeterH wrote:You think of something like $a[$i1,$i2] or alike?
Re: SC: Array and Hashtable/Hashmap/Dictionary
My two paise:
A handful of new builtin functions maybe more unambiguous than the usual bracket notation. XY still allows unquoted strings, so $arr[$i] can be interpreted as an interpolated string, or pattern.
Code: Select all
$a = $b[$i]; // can be interpreted as $a = $b . '[' . $i . ']';
$a = []; // is $a an empty array or the string '[]' ?
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]
[ this user is asleep ]
-
- Site Admin
- Posts: 60558
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: SC: Array and Hashtable/Hashmap/Dictionary
I have a big list of fascinating things to come, and real arrays are one of them.
But, yes, first I have to dig through some layers of unanswered forum posts...
But, yes, first I have to dig through some layers of unanswered forum posts...
FAQ | XY News RSS | XY Twitter
Re: SC: Array and Hashtable/Hashmap/Dictionary
admin wrote:I have a big list of fascinating things to come, and real arrays are one of them.
More SC teasers possible?
Yeah, I guess there are some rewrites ahead for me...
Re: SC: Array and Hashtable/Hashmap/Dictionary
Just integrated Don's note on switch() statement.
Maybe someone could change the thread titel to something more script generic.
Maybe someone could change the thread titel to something more script generic.
Re: SC: Array and Hashtable/Hashmap/Dictionary
You started this thread, edit it's title!
One of my scripts helped you out? Please donate via Paypal
Re: SC: Array and Hashtable/Hashmap/Dictionary
Sigh, stupid me.highend wrote:You started this thread, edit it's title!
Don, do you mind calling it Scripting 3.0?
-
- Site Admin
- Posts: 60558
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: SC: Array and Hashtable/Hashmap/Dictionary
I find the current title okay. It tells me something.
FAQ | XY News RSS | XY Twitter
Re: SC: Array and Hashtable/Hashmap/Dictionary
If Dictionaries/Associative Arrays should become implemented, I would expect them to be "permanentable".
Actually this is mere rhetorical, since you never would accept such an exception because it destroys any elegance and balance. I'm rather asking because it could save me some boiler-plate ini-file related code in the future.
Actually this is mere rhetorical, since you never would accept such an exception because it destroys any elegance and balance. I'm rather asking because it could save me some boiler-plate ini-file related code in the future.
Re: SC: Array and Hashtable/Hashmap/Dictionary
Any update on Arrays, Don?
FH
FH
-
- Site Admin
- Posts: 60558
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: SC: Array and Hashtable/Hashmap/Dictionary
Not yet, I'll let you know...
FAQ | XY News RSS | XY Twitter