[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Writing about probeDisplays: what do you think?
From: |
Ken Cline |
Subject: |
Re: Writing about probeDisplays: what do you think? |
Date: |
Thu, 27 May 1999 19:28:34 -0400 (EDT) |
On Thu, 27 May 1999, glen e. p. ropella wrote:
> > probeMap = [CustomProbeMap create: aZone forClass: [self class]
> > withIdentifiers: "numbugs",
> > "diffuseConstant", "worldXSize",
> > "worldYSize","minIdealTemp",
> > "maxIdealTemp","minOutputHeat",
> > "maxOutputHeat", "evaporationRate",
> > "toggleRandomizedOrder"
> > "randomMoveProbability",":",
> > "addHeatbug:", NULL];
> >
>
> Right.
>
> >But there's no way to add setHideResult: 1 here, so one price of the
> >Custom Probe Map is lack of detail?
>
> Right again. The two limitations to the shortcut are that you
> can't design cross-class probeMaps and you can't set hideResult.
> It assumes you want to see the results. A defaultHideResult
> would be a nice feature. Or a message one could send to the
> probeLibrary (or somewhere) telling it how to set the hideResults.
(Being too lazy to look at the code myself...)
Couldn't you just do leave off the "addHeatbug:' and add it
after creating the CustomProbeMap, i.e.
id <Probe> anotherProbe = NULL;
anotherProbe = [ probeLibrary getProbeForMessage: "addHeatbug:"
inClass: [self class] ];
[ anotherProbe setHideResult: 1 ];
probeMap = [CustomProbeMap create: aZone forClass: [self class]
withIdentifiers: "numbugs", ...
[probeMap addProbe: anotherProbe ]
Am I forgetting something?
> Anyway, I assume that, since it's not in any of the apps and few
> people know about it, that it's not a useful feature.
I found it quite useful; not to mention a good place to see
how to write variable argument methods. Thanks! =:-)
> Since we've started using regular macros to condense code,
> maybe this should be a macro instead of a convenience
> method.
Well, that opens up a (perhaps) lengthy discussion about the
trade-offs of using macros versus functions. In particular,
I been wondering if macro use (in Swarm) makes integrating
with other languages (e.g. Java) more difficult? (Don't get
me wrong, I love macros. I wish Java had them. But I have
to admit that I've been guilty of writing a macro when a
function would have been adequate.=;-)
Ken.
_________________________________________________________
Ken Cline address@hidden
SAIC VOICE (410) 571-0413
Annapolis, MD FAX (301) 261-8427
==================================
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.