[cl-irregsexp-devel] some smaller patches

Attila Lendvai attila.lendvai at gmail.com
Wed Sep 30 19:25:03 UTC 2009


> However, why do you feel the need to rename max-len and min-len? They
> are used already and there are still many variables called x-len . . .


abbreviations are bad, because there are a million of them while
there's only on non-abbreviated form (ideally, if the naming is
obvious).

arguably in this case it should be :maximum-length but max/min is so
well spread that it's one of the very few abbreviations that we accept
internally in public API. but it's your lib... my patches are only
suggestions! :)


>> Subject: [PATCH] some care for replace.lisp, notably get rid of the
>> single usage of iterate
>
> What's wrong with iterate?


well, not much, except that it feels a bit like an oddball in the code
with the iter: package prefixes. and it's one more dependency for a
single use... otherwise i don't have much against iter (except that it
screws up the environment which brakes various things inside its body,
but that's a whole different story)


> You change it to an nreverse!


do some profiling... ;)

it's not faster for sure, but i doubt you'll be able to point out the
difference.


> Why are you using BODY here for a non-code form?


it plays much better with slime indentation, but that's about all.

i usually freely exchange &body and &rest as they have no other
effects than that (and documentation-wise it's arguable that the body
there really is a body, that body is just a DSL not lisp...)


> This makes no difference I believe ^^^^


profile it. on sbcl with-output-to-string creates a
string-output-stream which is more expensive when pretty-printing
stuff is initialized.


> This rewrite seems in aid of faster string concatenation. I have a good
> strcat somewhere, I can put that in. Do you have a benchmark?


not for this specific case, but i went through quite a few profiling
sessions and it seemed to be the fastest string concatenation (on
sbcl).

-- 
 attila




More information about the Cl-irregsexp-devel mailing list