www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Outer names, binding

A blog post that shows some of the good things done by split (among the things
it does, it supports the  only  attribute that is the "unique" Bartosz talks

One of the attributes supported by Split suggests me something like:

void foo(string s) outer out x {
	x = s.length;

After "outer" there's the list of the names of the enclosing namespace that are
used inside foo(). In this "outer out x" means that foo() overwrites x.

Knowing/stating what globals (or the outer scope) a function/method uses sounds


JavaFX lets you bind, or link, attributes so that when one attribute changes,
all attributes bound to it will automatically change as well.<:

In Python "Cellulose" is vaguely similar (but this isn't a built-in features of the language, it's a module):
Cellulose provides a mechanism for maintaining consistency between
inter-dependant values with caching and lazy evaluation. You can think of it
like a spreadsheet program -- Many cells are are calculated from the values of
other cells. When one cell changes, all of the dependant cells get updated with
new values. However, cellulose goes quite a ways beyond this. It guarantees
that when a value is read, it is consistant with all the values it depends on.
It also is lazy (read: efficient.) Calculating a value is put off till the very
last possible moment, and only recalculated when absolutely needed. Dependency
discovery and cache invalidation are fully transparent and automatic.<

Bye, bearophile
May 30 2009