Graal Forums  

Go Back   Graal Forums > Development Forums > Future Improvements
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-05-2009, 08:26 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Hash Arrays

Well I've recently found a liking to Ruby and it's hash arrays. It would be really rad if we had them in GS2. Hash rockets ftw.

Theory usage:

PHP Code:
function onCreated() {
  
temp.noises = {
    
"cat" => "meow",
    
"dog" => "woof",
    
"manbearpig" => "rawr",
    
"algore" => "im super serial guise"
  
};
  
temp.data = {
    :
ip => "127.0.0.1",
    :
port => 8080
  
};
  echo(
temp.noises["cat"]); // would echo "meow"
  
echo(temp.data[:ip]); // would echo "127.0.0.1"

__________________
Quote:
Reply With Quote
  #2  
Old 12-05-2009, 08:35 AM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Wow, that's pretty awesome. I support this suggestion.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #3  
Old 12-05-2009, 08:52 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Given how long we've requested associative arrays for....
Reply With Quote
  #4  
Old 12-05-2009, 01:08 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by Twinny View Post
Given how long we've requested associative arrays for....
Aye. Doubt we'll get it.
Reply With Quote
  #5  
Old 12-05-2009, 04:11 PM
Codein Codein is offline
jwd
Codein's Avatar
Join Date: Oct 2005
Location: Greater Manchester
Posts: 2,423
Codein has a spectacular aura aboutCodein has a spectacular aura about
Send a message via AIM to Codein Send a message via MSN to Codein
I agree with this and I have done since it was last requested but was given this explanation in a round about way...

Quote:
Graal has dynamic variable names so you can achieve similar results using objects.
Reply With Quote
  #6  
Old 12-05-2009, 05:02 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by Codein View Post
I agree with this and I have done since it was last requested but was given this explanation in a round about way...
Maybe Stefan could just real-time translate child objects to work with an associative array syntax. Lua kind of does it as well:
NPC Code:
local arr = { x = 30, y = 40 };
print(arr["x"] .. ", " .. arr.y); -- "30, 40"

Reply With Quote
  #7  
Old 12-05-2009, 05:08 PM
Codein Codein is offline
jwd
Codein's Avatar
Join Date: Oct 2005
Location: Greater Manchester
Posts: 2,423
Codein has a spectacular aura aboutCodein has a spectacular aura about
Send a message via AIM to Codein Send a message via MSN to Codein
Quote:
Originally Posted by Crow View Post
Maybe Stefan could just real-time translate child objects to work with an associative array syntax. Lua kind of does it as well:
NPC Code:
local arr = { x = 30, y = 40 };
print(arr["x"] .. ", " .. arr.y); -- "30, 40"

I like that idea! I think I'm gonna have to go try Lua out sometime soon, to be honest
Reply With Quote
  #8  
Old 12-05-2009, 05:09 PM
Crono Crono is offline
:pluffy:
Join Date: Feb 2002
Location: Sweden
Posts: 20,000
Crono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond repute
this feature should be implemented im serial guys
__________________
Reply With Quote
  #9  
Old 12-05-2009, 06:54 PM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Eeewwww, Perl. Lua or Python syntax = way better
I guess the issue why it's never done is because Stefan is entirely too lazy to change anything that involved the syntax, rather than just adding a function or object.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #10  
Old 12-05-2009, 06:59 PM
Codein Codein is offline
jwd
Codein's Avatar
Join Date: Oct 2005
Location: Greater Manchester
Posts: 2,423
Codein has a spectacular aura aboutCodein has a spectacular aura about
Send a message via AIM to Codein Send a message via MSN to Codein
Quote:
Originally Posted by coreys View Post
Eeewwww, Perl. Lua or Python syntax = way better
I guess the issue why it's never done is because Stefan is entirely too lazy to change anything that involved the syntax, rather than just adding a function or object.
This isn't really a high priority request in my opinion. It's uses are almost, if not fully, emulated by dynamic naming and objects. It'd be nice, sure, but it's not like it's REALLY needed.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 05:56 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.