[Coldstuff] More suggestions

xmath xmath@nubz.org
Fri, 4 Jan 2002 17:00:41 +0100


>This could be useful, but the name for it should probably be similar 
>to one of the existing languages out there which provides this 
>feature just to help make it slightly more familiar.

Yes, the name was just suggestive ofcourse.. I don't know which other 
languages support it, or what it's called there


>There are performance issues for this patch, especially in the dev 
>tree.  Any code that relies upon calling methods and getting back a 
>~methodnf if it doesn't exist runs much faster in the dev tree 
>because we cache negative responses.  This moves some of the 
>handling of that into the DB, makes the method cache less effective, 
>etc.

You can put in the requirement that if handle_call_method exists and 
fails (throws ~methodnf), it must do so consistently. Then negative 
caching should be ok, you just need to flush the relevant parts when 
handle_call_method is altered.


>I suspect that you'd like this for doing RPC-based distribution, 
>right?  If so, there are other ways that you can accomplish the same 
>end goal (distribution) without some of the issues.

Frobs yes.. I suppose it isn't needed that badly


>  > 2. [Genesis] Why isn't there a way to do bitwise operations (and, or,
>  > xor, not). Doing bitwise and is sometimes possible with %, and doing
>  > bitwise not is possible by doing (1-value) but it's not as nice..
>
>There are native methods on $integer for this.

OK, hadn't seen those yet.

Maybe a different suggestion: better docs? :-)  (if there's some 
convenient way for me to add those, I'd be happy to supply some)


>  > 3. [Genesis] Support exponentiation of integers:
>
>This should be okay.

see http://www.nubz.org/pow.c.txt  for implementations


>  > 4. [Genesis] It's a bit annoying that to convert a negative
>  > integer to a negative objnum, I have to do: fromliteral("#"
>  > + tostr(num)) because toobjnum doesn't work in that case. Maybe
>  > add an optional argument to toobjnum, "allow-negative" ?
>
>What happens if you j ust toobjnum(abs(num)) ?  Is there a reason 
>that toobjnum() imposes this restriction?

#1 is $root, #-1 is #-1, #1000 is #1000, #-1000 is #-1000

Apparently (haven't digged into the details of this mechanism yet) 
invalid objects are returned as negative numbers in certain cases, 
but it looks like positive and negative numbers are still different 
things.

I want this ability to be able to convert any value to a buffer and 
back, without change (for RPC), so #-123 should be #-123, not #123


>  > 5. [Genesis] Where is tofrob?
>
>   <object, data, handler>

Strange.. now it works.. last time I tried that I got a parse error 
so I assumed that didn't work or so. Disregard this suggestion then.


>  > 6. [Genesis] Why does objnum() exist? Why not do toint(this())
>  > instead?
>
>Cognitive differences.  You're asking for the objnum.

this() is the objnum, with data type OBJNUM :-)
anyway, it's not important ofcourse.. it just seemed a little redundant to me


  - xmath