[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: xml pull parser
- From: Javier Guerra Giraldez <javier@...>
- Date: Mon, 21 Mar 2005 07:23:50 -0500
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
PA wrote:
>
> On Mar 21, 2005, at 12:08, Adam D. Moss wrote:
>
>> ... isn't safe against stuff like &apos; The correction is
>> fairly obvious. :)
>
> I added an additional string.gsub( aString, "&", "&" ) before
> decoding the other entities. Is it what you had in mind?
i guess the string.gsub( aString, "&", "&" ) should be the last
replacement.
in your original example:
while ( true ) do
local aType, aContent, aName, someAttributes = anInputStream.read()
if ( aType == nil ) then
break
....
could be a bit more 'lua like':
for aType, aContent, aName, someAttributes = anInputStream.read()
if ( aType == ....
.....
.....
end
it's a very small point, but i mention it, because in general i've seen
your code is well structured, but very 'unlua', making it less efficient
and less useful to others
You're writing code at an incredible rate, but at the same time you're
creating your own style and drifting away from the others. I don't want
to reignite the discussion about OOP vs FP vs anything else; just
remember that not everything has to be an object.
i think it was you (hope i'm not mixing memories) who said that you're
fairly new to Lua, and that you liked to learn a language by
reimplementing on it what you already know. It's obvious that by now
you have a more than average hold of the Lua language itself; why don't
you try to restructure some of your work more closely to the 'lua way' ?
you'll find that you won't have to fight against the language anymore!
OTOH, maybe some people here like your style... if that's so, i should
shut up.
- --
Javier
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCPrzWsIoGnxsRK/ERAo0pAJwICTvp5iiHuQ8DxVZ4C73ve5NHKgCeL80N
MTUCmDd/qF0L0HqTDN2gABM=
=k4/j
-----END PGP SIGNATURE-----