[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Adding some restrictions to users
- From: Tobias Käs <tobias.kaes@...>
- Date: Tue, 20 May 2003 22:06:52 +0200
You could use metamethods to implement a read-only table, by implementing
the 'index' metamethod.
As far as i know it is not possible to restrict variable assignment, but I'm
not sure if there are some special cases or some new aspects in Lua 5.
----- Original Message -----
From: "Javier Gonzalez" <Xavier_Gonzalez@lycos.es>
To: <lua@bazar2.conectiva.com.br>
Sent: Tuesday, May 20, 2003 9:04 PM
Subject: Adding some restrictions to users
> Hello, I have a doubt.
> In lua5, how could I do so:
> x = y
> is disallowed, being x any variable and y a C function
>
> Also, how could I make a table "say protected" to be read only? (no way to
> modify/create/delete indexes)
>
> Thanks in advance
>