[Hecl-devel] numberthings, classes and flags
Brought to you by:
davidw
From: David N. W. <da...@de...> - 2006-03-26 19:37:11
|
David N. Welton wrote: >>>I was looking at the class hierarchy of all the various number things, >>>and had a thought: perhaps we could use flags instead of IntegralThing >>>and FractionalThing? >>Sorry, I do not understand this point. What do you mean iwth flags? I >>prefer a method since this is more flexible when extending the numebr >>type hierarchy. > > > Thinking before trying it can be dangerous, but... maybe something like > this: in NumberThing, have some flags like > > boolean isWholeNum; > boolean isFractionalNum; > > and then just put the methods there? I had a look... the FractionalThing and IntegralThing classes just don't take up much space... eventually I wouldn't mind getting rid of them, but I'll save that for later. The various *Op.class files take up more than 1K though... hrm. What's really grown are the various *Cmds.class files. To some degree, that makes sense, because the command names have been moved there. However, Interp.class should have shrunk quite a bit, but it didn't... not much, at least: Old: -rw-r--r-- 5509 22-Mar-2006 22:56:32 org/hecl/Interp.class -rw-r--r-- 3857 22-Mar-2006 22:56:32 org/hecl/ListCmds.class -rw-r--r-- 2650 22-Mar-2006 22:56:32 org/hecl/InterpCmds.class New: -rw-rw-rw- 4639 26-Mar-2006 18:58:54 org/hecl/InterpCmds.class -rw-rw-rw- 4984 26-Mar-2006 18:58:54 org/hecl/ListCmds.class -rw-rw-rw- 4639 26-Mar-2006 18:58:54 org/hecl/InterpCmds.class I think I may have found something. When I do javap -c InterpCmds, it shows //String proc (for example) twice! I don't understand if that's significant or if it's just javap giving me funny results... -- David N. Welton - http://www.dedasys.com/davidw/ Linux, Open Source Consulting - http://www.dedasys.com/ |