Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Future Improvements (https://forums.graalonline.com/forums/forumdisplay.php?f=10)
-   -   const arrays (https://forums.graalonline.com/forums/showthread.php?t=72208)

napo_p2p 02-15-2007 08:04 AM

const arrays
 
We can do things like:
PHP Code:

const VAR = 1

However, this does not work:
PHP Code:

const ARR = {123}; 

It would be nice if it did :).

Twinny 02-15-2007 08:11 AM

Might be able to do
PHP Code:

const var1 1;
const 
var2 2;
const 
var3 3;
array = {
var1var2var3}; 


napo_p2p 02-15-2007 08:17 AM

Quote:

Originally Posted by Twinny (Post 1277812)
Might be able to do
PHP Code:

const var1 1;
const 
var2 2;
const 
var3 3;
array = {
var1var2var3}; 


Nice idea :). It's good for small arrays, but for bigger arrays it is a bit impractical.

Tyhm 02-15-2007 09:45 AM

I approve.

Twinny 02-15-2007 09:57 AM

Maybe constant arrays can be added at the same time as protected variables ^^.

Admins 02-15-2007 11:48 AM

To be efficient the const arrays would need to be like normal variables, similar like they are in most languages (only the compiler complains when you access a variable marked as const). It is not planned yet to add that, it's different to the normal const and enums.


All times are GMT +2. The time now is 12:24 PM.

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