Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Speeding up code

From: joel:neely:fedex at: 20-Feb-2002 7:14

Hi, Sunanda, [SunandaDH--aol--com] wrote:
> ... I've been offline for most of a week up in the hills ... >
Welcome back! I'm jealous! ;-)
> > Just out of curiousity, why? I saw that, but didn't > > understand it. > > Simply because the interface spec says it returns False if you > call it wrongly (e.g. to end an unstarted timer). False for no > action specified looked orthogonal to me. >
Thanks. I must confess that I'm still scratching my head over the issue of failure and out-of-domain arguments. REBOL can't seem to make up its mind about "bottom"; one sees all of the following from various functions: - NONE - UNSET! - ERROR! and I haven't figured out the decision criteria...
> ... If you take this object... > > myob: make object! [ > var1: 0 > var2: 10 > print ["object initialized"] > func1: [] [print "func 1 called"] > ] > > ...the two var assignments and the print statement will be > executed as part of the object initialization. >
But not when one uses MYOB as a prototype, as in otherob: make myob
> I am right (aren't I?) that there is not implicit (= automatic) > finalization/destructor code in a Rebol object, so my object > doesn't get a last gasp to do something when I code: > > unset 'myob >
AFAIK that's correct.
> The ability to save and reload objects which contain code is a > very powerful one. So far, I've resisted using it -- the only > objects I do save and later reload are data structures. > > I think I'm resistant because I see some horrible maintenance > problems. I'd end up with code snippets spread widely across my > database and no obvious way of changing them all to the latest > version. >
I completely agree. This is a direct consequence IMHO of the decision to use a prototype model for objects (instead of a class model). I've wool-gathered a bit about how to apply delegation model concepts, but haven't satisfied myself with any thoughts to date WRT to the issues you outlined above. -jn- -- ; sub REBOL {}; sub head ($) {@_[0]} REBOL [] # despam: func [e] [replace replace/all e ":" "." "#" "@"] ; sub despam {my ($e) = @_; $e =~ tr/:#/.@/; return "\n$e"} print head reverse despam "moc:xedef#yleen:leoj" ;