>>>>> "Hrvoje" == Hrvoje Niksic <hniksic(a)srce.hr> writes:
>> Is there any reason I should *not* change things like this to
>> read:
Hrvoje> Yes, I'll name one good reason: you should try not to
Hrvoje> change code that it not actively maintained by the XEmacs
Hrvoje> team without a good reason. Changing (car (car foo)) to
Hrvoje> (caar foo) is not a good reason.
What if the changes are accepted by the upstream maintainers? I can
submit a patch, once I find out who to send it to, and whether it
will actually end up in the canonical CVS repository for `pcl-cvs'.
>> Another question that comes to mind is "Why aren't the cXr
>> accessors subrs?" It seems like that would be way faster, and
>> there may be code that would benefit from it.
Hrvoje> No, it would actually be slower. `car' has its own
Hrvoje> byte-code, while a new `caar' subr would have to be
Hrvoje> invoked through the normal means of `funcall', ending up
Hrvoje> much slower than double BCAR. Witness the joys of Emacs
Hrvoje> Lisp!
I see. They would need their own byte codes to make it faster... and
there's not enough to go around, + the slight speedup in the small
amount of code that could benefit from this wouldn't warrant doing that.
>> Is there any advantage in converting (function (lambda () ...))
>> to
>> #'(lambda () ...) other than for readability?
Hrvoje> No. The forms are entirely equivalent, both in Common
Hrvoje> Lisp and in Emacs Lisp. In fact, the latter is silently
Hrvoje> converted to former at read-time.
Ok; yes, it's just a reader-macro then. It occured to me there ought
to be one for regular expressions... it would compile them and let
you stow them in a variable, to use with a regexp-exec function. I
think I'd want that in `guile' too.
>> Or `((, var) ...) to #`(,var ...)?
Hrvoje> You mean `(,var ...), right?
Yes, of course.
Hrvoje> Besides the obvious readability improvement, you might
Hrvoje> count as an advantage that the new-style backquotes are
Hrvoje> compatible with Common Lisp.
I went and got the CLISP sources; it's in my queue; doubt I'll really
understand much this year, but it's there anyhow. :-) I plan to try
and understand `guile' first, since it's much simpler.
Hrvoje> When you write new code, however, feel free to use
Hrvoje> caar/#'(lambda ...)/new-style-backquotes/etc.
Ok.