lua-users home
lua-l archive

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



Has anyone tried to do Lua code in .rtf?

That is, a reader (chunk loader, whatever) that reads in not .lua (raw ansi text) but a document that can have bold, italics, underlinings, even pictures.

I had this idea about 10 years back, using Borland C++. Why couldn't source have commenting pictures etc. attached right there. But it doesn't. Not even in 2003. :)

-ak



John Mckenna kirjoittaa keskiviikkona, 5. maaliskuuta 2003, kello 11:56:

Alex Bilyk writes:

'flags = FOO_BLUEPANTS + FOO_3PLANES + FOO_EDIBLE' ?

This will result in totally unreadable/misinterpreted code, IMHO. The
assumption that '+' can somehow intuitively be realted to '|' is ungrounded
to say the least.

On the "all programming languages look like C" planet, perhaps. For the
rest of us, the use of | for a set union operator is totally baffling.

My first choice would be the standard mathematical symbols. But that
requires Unicode - maybe the industry will have got its act together in ten
years or so. I want to be able to type these things easily.

My second choice: + for union, - for difference (A - B is the members of A
that are not members of B), and * for intersection. The empty set is nil.
Then you can say

FOO_ALL = FOO_BLUEPANTS + FOO_3PLANES + FOO_EDIBLE + FOO_WOBBLY + FOO_ALIEN
if flags * (FOO_ALL - FOO_EDIBLE) then
end

I believe this can be implemented in pure Lua, or with C helper functions
for speed. Certainly no changes to the core language are required.
-Virus scanned and cleared ok