Alright...I just slapped together a little echo script to help me get a
feel for text handling in Oz. Here it is my ozecho script...
functor
import
Application
Open
define
Args = {Application.getArgs record('in'(single type:string))}
%% 'out'(single type:string))}
Status = try
O={New Open.file init(name: stdout flags:[write create
truncate])}
in
local
proc {PutOut}
S={Args.'in'}
in
if S\="" then
{O write(vs:S)} {PutOut}
end
end
in
{PutOut}
end
0
catch _ then 1
end
{Application.exit Status}
end
The compiler doesn't give me any problems with this. However, when
running it with an argument, it pukes. ozecho --foo gives me this error...
%***************** Error: application programming ***************
%**
%** unknown option `foo'
%**
%**
%** Call Stack:
%** procedure 'GetLongOptSpec' in file "./ap/Application.oz", line 474, column
2, PC = 136070008
%** procedure 'ParseLongOpt' in file "./ap/Application.oz", line 497, column 2,
PC = 136070204
%** procedure 'ParseOptions' in file "./ap/Application.oz", line 517, column 2,
PC = 136070952
%** procedure 'ProcessArgv' in file "./ap/Application.oz", line 747, column 3,
PC = 136034076
%** procedure in file "./ozecho.oz", line 1, column 0, PC = 135799404
%** procedure 'RootManager,Pickle/fast' in file "./init/Module.oz", line 244,
column 6, PC = 135764704
%** procedure in file
"/home/kost/compile/build-1.3.0/updates/mozart/share/lib/base/Base.oz", line
92, column 7, PC = 135883484
%
The command "ozecho foo" doesnt do anything.
However, that last line in the error message looks a little strange. Who's
kost? Their not on my host, that's for certain. Hardcoded path in the
compiler perhaps? This is version 1.3.1 that I've downloaded.
All the other stuff I've written so far seems to work just fine. Any
pointers would appreciated.
Freejack
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users