<aw->
i'm wondering if (hex) should do it by default
<Regenaxer>
I think better not
<Regenaxer>
save the zero if not needed
<aw->
ok
<Regenaxer>
A leading zero means "octal" if parsed by other languages
<aw->
right right
<aw->
this is fine, i'll handle it in my code
<Regenaxer>
great
<Regenaxer>
Anyway it is better to keep the primitives simple
<Regenaxer>
Easier to pad an output than to remove undesired default stuff
<aw->
agreed
<beneroth>
<Regenaxer> Easier to pad an output than to remove undesired default stuff
<beneroth>
aye
<beneroth>
this is a essential picolisp pillar
<Regenaxer>
:)
<beneroth>
which also explains why some/many functions don't validate their input
<Regenaxer>
yeah, depends
<Regenaxer>
Most return NIL
<beneroth>
in principle I agree with aw-, everything should validate everything all the time, so any mistakes are detected as quick as possible, not chaining all over the place
<Regenaxer>
right
<Regenaxer>
hex did not do that
<Regenaxer>
now it returns NIL
<beneroth>
but picolisp is an optimized interpreter, and runtime checks cost time, and in many use cases the code can practically only have such errors during development
<beneroth>
so I also agree with you, Regenaxer :)
<Regenaxer>
:)
<beneroth>
leaving the runtime checks away, allows to make a wrapper around it anytime
<beneroth>
or patching it (which is an invisible wrapper) using (redef)
<beneroth>
but the other way is not so easily available
<Regenaxer>
right
<beneroth>
the issue boils down to managing the expectations of the programmers :)
<Regenaxer>
on the other hand, if things are checked anyway (to be handled correctly), returning NIL is best
<beneroth>
T
<beneroth>
btw my code is quite often (de someFunc (param) (ifn param-check1 error (ifn param-check-2 ...))
<beneroth>
(there are different ways to structure that. some make picolisp looking suddenly big - but intensive error handling / defensive programming is blowing up code in kinda all languages. some ways to structure that can also be a bit more clever and more elegant, with functions or (catch ... (throw)))....
<beneroth>
it depends...
<Regenaxer>
exactly
<Regenaxer>
Good for the programmer. Needs to be aware what he does ;)
<beneroth>
T
<beneroth>
bad for the mainstream appeal ;-)
<Regenaxer>
T
<beneroth>
freedom is not easy. freedom is responsibility. freedom is scary.
aw- has quit [Quit: bbl]
rob_w has quit [Remote host closed the connection]