[Swift-user] app argument int passed as float
Michael Wilde
wilde at mcs.anl.gov
Fri Oct 21 14:33:48 CDT 2011
In at least some recent version of trunk, ints seem to get passed ok, as below.
Now lets see where the difference is.
- Mike
bri$ cat args.swift
type file;
app (file o) echo(int i)
{
echo i stdout=@o;
}
file eo<"echo.out">;
eo=echo(123);
bri$ which swift
~/swift/rev/trunk/bin/swift
bri$ swift -version
no sites file specified, setting to default: /home/wilde/swift/rev/trunk/etc/sites.xml
Swift svn swift-r5234 cog-r3296
bri$ swift args.swift
no sites file specified, setting to default: /home/wilde/swift/rev/trunk/etc/sites.xml
Swift svn swift-r5234 cog-r3296
RunID: 20111021-1431-8mzx0ya2
Progress: time: Fri, 21 Oct 2011 14:31:04 -0500
Final status: Fri, 21 Oct 2011 14:31:04 -0500 Finished successfully:1
bri$ cat echo.out
123
bri$
----- Original Message -----
> From: "Ketan Maheshwari" <ketancmaheshwari at gmail.com>
> To: "Swift User" <swift-user at ci.uchicago.edu>
> Sent: Wednesday, October 19, 2011 8:30:24 PM
> Subject: [Swift-user] app argument int passed as float
> Hi,
>
>
> In my app definition, I have an argument of type int that is expected
> by the executable.
>
>
>
> I define my app something like this:
>
>
> (outfile o ) app myapp(string a, int b, datafile c, ...){
> cmd a b c stdout @o;
> }
>
>
> I call this as:
> <..mappers..>
>
>
> out = myapp("foo", 35, @afile, ...);
>
>
> However, it seems that at the time of the actual call, the value 35
> which is an int get replaced by the value 35.0, a float.
>
>
> I could see this from the arguments dumped by swift at the end of
> exception message:
>
>
> "
>
> Exception in presgt:
> Arguments: [TEST, 35.0, .....
> "
>
>
> The underlying app binary doesn't like because apparently the java is
> calling Integer.parseInt and getting a float formatted string.
>
> Any ideas?
>
>
> Regards, --
> Ketan
>
>
>
> _______________________________________________
> Swift-user mailing list
> Swift-user at ci.uchicago.edu
> https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-user
--
Michael Wilde
Computation Institute, University of Chicago
Mathematics and Computer Science Division
Argonne National Laboratory
More information about the Swift-user
mailing list