View Issue Details

IDProjectCategoryView StatusLast Update
0000753LDMud 3.6Generalpublic2022-09-19 22:46
Reporterbubbs Assigned ToGnomi  
PrioritynormalSeverityfeatureReproducibilityN/A
Status resolvedResolutionfixed 
Fixed in Version3.6.6 
Summary0000753: Ranged mapping indexing
DescriptionI'd like to propose ranged mapping indexing, allowing wide mapping values to be accessed as an array. For instance;

mapping map1 = ([ "a": 1; 2; 3, ]);

printf("%Q\n%Q\n", map1["a", 0..2], map1["a", <2..]);

Additionally, it would be a natural extension to use these as l-values, so -

map1["b", 1..2] = ({ 4, 5, });

Coping mapping values from one mapping to another would become a lot easier -

map2["c", ..] = map1["a", ..];

As for the closure versions of these operators, I'd suggest reusing the existing ranged closures (#'[..], #'[<..], #'[..<], #'[<..<]), accepting an additional argument as the mapping key -

funcall(#'[..], map1, "a", 0, 2) == map["a", 0..2]);


I think this would be a logical extension to the language, making wide mappings easier to manipulate. However, I understand how much time these things take and I'd like to express my gratitude for the work being done and to all contributors.
TagsNo tags attached.

Relationships

parent of 0000546 resolvedGnomi LDMud 3.5 Rework lvalue handling 
has duplicate 0000294 resolvedGnomi LDMud 3.6 Range operator in mappings 

Activities

Gnomi

2010-07-22 00:55

manager   ~0001888

Interesting idea. I'd like to do this, but after 0000546 is finished, otherwise we might code it twice.

fufu

2021-04-16 20:01

manager   ~0002602

The closures should get new names, #'[,..], #'[,<..], etc. (This is consistent with the existing #'[,]).

Issue History

Date Modified Username Field Change
2010-07-18 13:14 bubbs New Issue
2010-07-22 00:55 Gnomi Note Added: 0001888
2010-07-22 00:56 Gnomi Relationship added parent of 0000546
2010-07-22 00:57 Gnomi Project LDMud => LDMud 3.5
2011-02-20 00:19 zesstra Relationship added has duplicate 0000294
2021-04-16 20:01 fufu Note Added: 0002602
2022-01-09 21:20 Gnomi Assigned To => Gnomi
2022-01-09 21:20 Gnomi Status new => assigned
2022-01-09 21:20 Gnomi Project LDMud 3.5 => LDMud 3.6
2022-01-09 21:20 Gnomi Category LPC Language => General
2022-09-19 22:46 Gnomi Status assigned => resolved
2022-09-19 22:46 Gnomi Resolution open => fixed
2022-09-19 22:46 Gnomi Fixed in Version => 3.6.6