lua-users home
lua-l archive

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


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mon, Aug 11, 2003 at 09:39:10PM -0700, Nick Trout wrote:
> Read as:
> 
> 	_,x = _,(nil or f())
> 
> "nil or 1" gives 1.

Thanks Nick, nice way to see it. I continue using my workaround:

local _,y = f()
x = nil or y	-- and now x = 99

Is there a way to assign x in one line? Just for elegance sake? :)

> http://lua-users.org/wiki/AssignmentTutorial
> 
> from
> 
> http://lua-users.org/wiki/TutorialDirectory

Thanks for the reference. But it was not in much particular help in
my case, I'd like to add. :) Thanks for the help.

> > Why the caret is being taken *literally*? Shouldn't it be a special
> char
> > indicating a regex start anchor?
> 
> I believe there is a bug here which has been pointed out before.

Ah, ok. Thanks once more.

Regards,
Luis.

- -- 
Mathematicians practice absolute freedom.
                -- Henry Adams

- -- 
Luis Carvalho
Applied Math PhD Student
Brown University
carvalho at dam dot brown dot edu

PGP Key: E820854A <carvalho@dam.brown.edu>
Available at: http://www.dam.brown.edu/people/carvalho/pgp-key
Fingerprint: 1339 9E5D DB0B 01B9 624D  AFF8 D738 BFA6 E820 854A

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE/OPJu1zi/pugghUoRAp+EAJ9lN/77aiWU8A7BJC3IK7Fj4vCFOQCcDMqn
TnFxoWSHfgpzbQYcX0Nusyk=
=iSJ9
-----END PGP SIGNATURE-----