User loginNavigation |
archivesindentation yet again?is there any thought about how to replace the currently too-much-indenting style ui with something more friendly to long discussions? Syntax of Literal Tables (Assocative Collections) and Auto-generated fieldsIn Heron I'm adding literal tables which like literal dictionaries/maps/hashes/tables in many languages (e.g. Python, Ruby, etc.) are intended to provide a convenient syntax for associative collection literals. The syntax looks like this: var animals = table(animal:String, sound:String, legs:Int) { "Dog", "woof", 4; "Cat", "meow", 4; "Human", "hello", 2; }; The first column is used as a key, and the "value" is an anonymous record containing the other columns. So you you can say: Question one: what other languages that have built-in support associative collections with more than two columns? Now obviously this looks a lot like a simple array of objects: but the identity is chosen as the first field. So an interesting application is to construct an object-oriented programming system built from tables alone. It would then be helpful if the first field could be an auto-generated immutable integer id (e.g. the object address, or the database auto-generated key field). So then the question becomes what syntax should I use? I'm thinking of something like: var animals = table(self:Id, animal:String, sound:String, legs:Int) { $, "Dog", "woof", 4; $, "Cat", "meow", 4; $, "Human", "hello", 2; }; Question two: I don't want to invent brand new syntax, what syntax do other languages use for similar features (auto-generated ids)? tools to evaporate problems(some muddling thoughts fermented with "adt vs. object" and "triz" and such.) What problems in PLT are best solved via better tools? And what are those tools? And what does it take to get there? And which ones already exist? For example:
By raould at 2010-01-20 22:21 | LtU Forum | login or register to post comments | other blogs | 3787 reads
see history of things i started (vs. commented on)?i'm looking for an old discussion but can't find it, i think i could better find it if i could restrict results by the name of the starter of the topic. but i don't see a way to do that? |
Browse archivesActive forum topics |
Recent comments
22 weeks 3 days ago
22 weeks 3 days ago
22 weeks 3 days ago
44 weeks 5 days ago
49 weeks 31 min ago
50 weeks 4 days ago
50 weeks 4 days ago
1 year 1 week ago
1 year 5 weeks ago
1 year 5 weeks ago