lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

>From Tue Jul 13 02:59:53 1999
>From: Dave Bollinger <>

>   Back in the list archives there are several threads about pointer
>aliasing, caching pointers to objects, and such - essentially describing
>the functionality of Pascal's "with" statement.

There's no way this can work given Lua's table semantics: there's no notion
of a field being present in a table, because tables are dynamic.
In other words, there's no way you can "test" whether "v" may refer to a field
in a table and not to a global variable, because it's legal to write t.v.
	with t do
would not work. Which of the three a,v,w are global?

unless you write something like:
	with t do
(which is ambiguous because it conflict with w=a.v)
Plus, if you're writing .w, why not write t.w?