Hmmm, then I am really confused. loc>> and (>>loc) are already defined as generics. I can "\ loc>> see" them and get a stack effect. I didn't think you had to specify the stack effort on method bodies because it is specified when the generic is defined.
I tried specifying the stack effect in the method body and still get problems. I think the issue is that there is no slot "loc" when I code M: loc-model (>>loc) set-model ; The line: M: loc-model loc>> value>> ; doesn't cause any problems, which seems strange since it to is using a generic without the slot being defined in the tuple. On Wed, Feb 4, 2009 at 12:43 AM, Slava Pestov <[email protected]> wrote: > Hi, > > The problem is you're defining a method on loc>>, and the method body > does not get optimized. As a result any word calling loc>> doesn't get > optimized either and this causes problems. > > My plan is to make all words optimized eventually and get rid of the > distinction. For now, make sure that code in method bodies on existing > generic words has a stack effect (you can use 'infer' to check). > > Slava > > On Tue, Feb 3, 2009 at 11:14 PM, Steve Weeks <[email protected]> wrote: >> Not sure what I'm doing wrong, but the following code makes factor go >> a little nuts. >> >> IN: sample >> >> USING: accessors models ; >> >> TUPLE: loc-model < model ; >> : <loc-model> ( loc -- model ) loc-model new-model ; >> M: loc-model (>>loc) set-model ; >> M: loc-model loc>> value>> ; >> >> >> I get 1900 semantic warnings and weird things happen like the help >> system gets alien-invoke-error instance errors. Other weird things >> too, I'll probably change my code and not try to wrap a model in code >> that makes it look like a loc. It is probably too cleaver any way. >> >> ------------------------------------------------------------------------------ >> Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) >> software. With Adobe AIR, Ajax developers can use existing skills and code to >> build responsive, highly engaging applications that combine the power of >> local >> resources and data with the reach of the web. Download the Adobe AIR SDK and >> Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com >> _______________________________________________ >> Factor-talk mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/factor-talk >> > > ------------------------------------------------------------------------------ > Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) > software. With Adobe AIR, Ajax developers can use existing skills and code to > build responsive, highly engaging applications that combine the power of local > resources and data with the reach of the web. Download the Adobe AIR SDK and > Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com > _______________________________________________ > Factor-talk mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/factor-talk > ------------------------------------------------------------------------------ Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use existing skills and code to build responsive, highly engaging applications that combine the power of local resources and data with the reach of the web. Download the Adobe AIR SDK and Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com _______________________________________________ Factor-talk mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/factor-talk
