[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: LispArchiver and long double.
From: |
Marcus G. Daniels |
Subject: |
Re: LispArchiver and long double. |
Date: |
02 Jul 2000 19:12:14 -0700 |
User-agent: |
Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.4 |
>>>>> "GO" == Gadi ORON <address@hidden> writes:
GO> Did anyone manage to read/write long doubles from lisp files?
The program below works for me with today's snapshot:
ftp://ftp.swarm.org/pub/swarm/src/testing/swarm-2000-07-02.tar.gz
Note that the text->double conversion is done with strtod, so
you'll only preserve the precision of a double.
It would be nice to have an autoconf check toi activate use of `strtold'
for systems that support it (e.g. Redhat).
#import <simtools.h> // initSwarmBatch
#import <defobj/Create.h> // CreateDrop
@interface Agent: CreateDrop
{
long double val;
}
- (long double)getVal;
@end
@implementation Agent
+ createBegin: aZone
{
Agent *obj = [super createBegin: aZone];
obj->val = 0.02;
return obj;
}
- (long double)getVal
{
return val;
}
@end
int
main (int argc, const char **argv)
{
initSwarmBatch (argc, argv);
{
id agent;
if ((agent = [lispAppArchiver getObject: "agent"]))
printf ("val: %Lf\n", [agent getVal]);
else
{
agent = [Agent create: globalZone];
[lispAppArchiver putDeep: "agent" object: agent];
[lispAppArchiver sync];
}
}
return 0;
}
/*
Local Variables:
compile-command: "$SWARMHOME/bin/libtool-swarm --mode=link gcc
-DAPPNAME=archiveLongDouble -o archiveLongDouble -Wall -Werror -g -Wno-import
-I$SWARMHOME/include/swarm -L$SWARMHOME/lib/swarm archiveLongDouble.m -lswarm
-lobjc"
End:
*/
==================================
Swarm-Support is for discussion of the technical details of the day
to day usage of Swarm. For list administration needs (esp.
[un]subscribing), please send a message to <address@hidden>
with "help" in the body of the message.