* the #'function type-in-code issue, (E)lisp, and C
@ 2015-10-04 0:56 Emanuel Berg
0 siblings, 0 replies; only message in thread
From: Emanuel Berg @ 2015-10-04 0:56 UTC (permalink / raw)
To: help-gnu-emacs
Remember the discussion that a #'function should be
put like that, sharp quoted?
I have now changed all of my code. The conclusions
are:
1) This made me `require' a lot of stuff that was
previously not required. This meant some pleasant
work, but did it also make the code more robust? - an
open question...
2) Sometimes it was difficult to know how to put it.
Here, the help came in handy. Here are two examples:
(put SYMBOL PROPNAME VALUE)
Store SYMBOL's PROPNAME property with
value VALUE.
so
(put 'upcase-region 'disabled nil)
but
(add-hook HOOK FUNCTION &optional APPEND LOCAL)
Add to the value of HOOK the function FUNCTION.
and consequently
(add-hook 'text-mode-hook #'text-mode-hook-f)
Now, the help came in "handy", but if you compare it
to the languages that do use types in the code all the
time, and are not ashamed to do so, we see that in
those languages there is never such detective work
required, at all!
For example, the language C. Do:
M-x printf(3) RET
and see that the first thing they tell you is
SYNOPSIS #include <stdio.h>
int printf(const char *format, ...); int
fprintf(FILE *stream, const char *format, ...); int
sprintf(char *str, const char *format, ...); int
snprintf(char *str, size_t size, const char *format,
...);
i.e., the types!
So here what I can see (E)lisp is at a clear
disadvantage as it is not only unclear what to do,
even when you decide what to do, if you decide to do
the function/symbol distinction, it is not clear how
to do it!
--
underground experts united
http://user.it.uu.se/~embe8573
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-10-04 0:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-04 0:56 the #'function type-in-code issue, (E)lisp, and C Emanuel Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).