[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: "dynamic" closures
- From: spir <denis.spir@...>
- Date: Mon, 30 Nov 2009 22:36:56 +0100
Jerome Vuarand <firstname.lastname@example.org> dixit:
> Upvalues are references to these "variable" objects. When you access
> the upvalue (by writing "print(t)"), you dereference it, and obtain
> the object that the variable points to at that dereferencing moment,
> not when it was created, not when the code was compiled, not when the
> closure was closed.
Yes, think that is the point I was trying to make with unskilled wording. When you mean "variable", there is a _name_ part which doesn't belong to "value.
My interpretation is: A pointer reference (as opposed to symbolic) can only refer to a value (located by address).
2 analogies for the case of symbolice reference (just to make clearer what I try to express):
* symbolic link in unix filesystem (if target where refered to by location, the link would be broken at first file change)
* instance --> class method lookup (inst.m acts as alias for class.m so replacement of class.m will be visible to instances)
In both cases, there are 2 name lookups in tables, while in a pointer reference is a shortcut.
la vita e estrany