lua-users home
lua-l archive

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


Thanks to everyone for their help earlier with the side effects.  The
sandbox approach will work for me.

Now on to the next issue.  Can somebody explain why I get different
results using print with the concatenation operators and using the
strings as separate arguments.  I presume it has something to do with
calls to tostring(), but it isn't clear.

For example, assume key hold "hello" and value holds "world".  Doing this:

print("'", key, "' = '", value, "'")

I get:

'       hello   ' = '   world   '

And doing:

print("'" .. key .. "' = '" .. value .. "'")

I get:

'hello' = 'world'

Where do the extra spaces come from in the former case?

Thanks,
Pete
-- 
--
"To love for the sake of being loved is human; to love for the sake of
loving is Angelic." -- Alphonse de Lamartine