[F-Script-talk] Re: FSArchiver/FSUnarchiver bug?
Brought to you by:
pmougin
From: Philippe M. <pm...@ac...> - 2002-05-28 10:24:25
|
Bill, Thank you for the report. It prompted the discovery of two very serious bugs in the Block archiving support. The first one prevents correct un-archiving of a block with cascade message. The exact nature and scope of the other bug is under investigation at this time (read: I'm not going to sleep a lot this night). Those bugs will be corrected in the next version and a source code patch will be available before that. You should also note that the way you archive the block in your example is not correct. FSUnarchiver is a private class that should not be used; only the F-Script run-time know how to use it. The correct way to save and load objects from F-Script is using the save: and load: methods (cf. section 9 of the guide). So in your example, you would do: > converter save:'/tmp/converter.fsobj' > cvt := sys load:'/tmp/converter.fsobj' Best, Phil ----- Original Message ----- From: "bill fancher" <fa...@pa...> To: <f-s...@li...> Sent: Saturday, May 25, 2002 11:21 PM Subject: [F-Script-talk] FSArchiver/FSUnarchiver bug? > Trying to archive the converter from "Scripting Cocoa with F-Script" I > encountered the following: > > > FSArchiver archiveRootObject: converter toFile: '/tmp/converter.fsobj' > true > > > cvt := FSUnarchiver unarchiveObjectWithFile: '/tmp/converter.fsobj' > > > cvt value: 'moo' > > Uncaught system exception: signal 10 > > This may have something to do with message patterns, as avoiding them > seems to avoid the problem. > > Paste the following into F-Script.app to reproduce: > > converter := [:title | |window conversionScript form button line| > window := NSWindow alloc initWithContentRect:(125<>513 extent:400<>200) > styleMask:NSTitledWindowMask + NSClosableWindowMask > + NSMiniaturizableWindowMask + > NSResizableWindowMask > backing:NSBackingStoreBuffered > defer:NO. > > conversionScript := [(form cellAtIndex:2) setStringValue:(form > cellAtIndex:0) > floatValue * (form cellAtIndex:1) floatValue. form selectTextAtIndex:0]. > > form := (NSForm alloc initWithFrame:(60<>90 extent:320<>85)) autorelease. > form addEntry:@{'Exchange Rate per $1', 'Dollars to Convert', 'Amount in > Other Currency'}. > form setAutosizesCells:YES; setTarget:conversionScript; setAction:#value. > > button := (NSButton alloc initWithFrame:(250<>20 extent:90<>30)) > autorelease. > button setBezelStyle:NSRoundedBezelStyle; setTitle:'Convert'; > setTarget:conversionScript; setAction:#value. > > line := (NSBox alloc initWithFrame:(15<>70 extent:370<>2)) autorelease. > > window contentView addSubview:@{form, button, line}. > window setTitle:title; orderFront:nil. > ]. > FSArchiver archiveRootObject: converter toFile: '/tmp/converter.fsobj'. > cvt := FSUnarchiver unarchiveObjectWithFile: '/tmp/converter.fsobj'. > cvt value: 'moo'. > > -- > bill > > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > F-Script-talk mailing list > F-S...@li... > https://lists.sourceforge.net/lists/listinfo/f-script-talk > |