View Issue Details

IDProjectCategoryView StatusLast Update
0000298LDMud 3.5LPC Compiler/Preprocessorpublic2009-10-06 04:16
ReporterlarsAssigned To 
PrioritynormalSeverityfeatureReproducibilityN/A
Status newResolutionopen 
Summary0000298: const parameters
DescriptionShort: const parameter
From: Markus Peter
Date: 2002-08-13
Type: Feature
State: New

Die andere Sache waer von der Prioritaet her eher niedriger, mehr ein
nice to have: Es waer schoen, einen "const" modifier oder aehnliches bei
der Parameteruebergabe zur Verfuegung zu haben, der _alle_ Schreibzugriffe,
also auch Schreibzugriffe auf in arrays/mappings enthaltene References
verhindert, und zwar mit einem Error, so dass ich einer Funktion etwas
uebergeben kann, und sicher weiss, dass es nicht veraendert wird, ohne
einen deep_copy zu machen. In wiefern das mit der Struktur des Drivers
umsetzbar ist, weiss ich nicht, bin mit dem Source leider nicht sehr
vertraut.

-- It might be done using special const-LVALUEs, but it's almost easier to
rewrite the LPC compiler. But the same mechanism could be used for
'const references' in general, and for opening up variables to inheriting
classes for read-only access (like Oberon's '+' visibility).
TagsNo tags attached.

Activities

_xtian_

2004-12-07 06:55

reporter   ~0000235

I am very much in favor of all ideas involving "const", "&"-parameters, etc, as this would greatly be of help in maintaining consistency and stability in large libraries. (error exclusion by good design)
Having always to do copy() / deep_copy() on referenced variables does take up a lot of ressources, just to prevent the possibility of misuse.

Issue History

Date Modified Username Field Change
2004-11-27 01:01 lars New Issue
2004-12-07 06:55 _xtian_ Note Added: 0000235
2009-10-06 04:16 zesstra Project LDMud => LDMud 3.5