[Dev-luatex] Subject: confused about arg value

H. van der Meer havdmeer at xs4all.nl
Sat Jul 31 19:17:00 CEST 2010

I might be very much mistaken or having missed something in the manual.
But I cannot explain the following behaviour:

Program in file test.lua:
#! /usr/local/bin/lua
if #arg == 0 then
  print "call this program with: test 5103"
  assert (arg[1] == 5103, "arg[1] is not 5103 but " .. arg[1])

Its output is when run:
116 ~/Projects/Lua/luaprograms/testing: lua test.lua 5103
lua: test.lua:5: arg[1] is not 5103 but 5103
stack traceback:
	[C]: in function 'assert'
	test.lua:5: in main chunk
	[C]: ?

It must have something to do with arg[1] not being precisely an  
integer, because replacing in the test arg[1] by arg[1]-arg[1]%1  
passes the assert.

I am really curious when an integer given on the commandline seems to  
turn into something not quite integer. Any ideas why? Must this be  
considered a bug or a feature.

Hans van der Meer

More information about the dev-luatex mailing list