Re: Symbol clashes: how to avoid them. Part 2
- From: Kaz Kylheku <kkylheku@xxxxxxxxx>
- Date: Fri, 31 Oct 2008 21:03:30 +0000 (UTC)
On 2008-10-31, Tamas K Papp <tkpapp@xxxxxxxxx> wrote:
On Fri, 31 Oct 2008 11:37:19 -0700, budden wrote:
- every independent expert would say very definitely that a.b.c is much
easier to read that (c-of (b-of a)). Don't even say about (slot- value
Great! How should I write
(defun analyze-statistic (statistics &option (type 'total))
(let* ((statistic (slot-value statistics type)
(a (calculate-a statistic))
(b (calculate-b statistic)))
;; ...
))
(analyze-statistic *statistics*)
(analyze-statistic *statistics* 'unemployed)
(analyze-statistic *statistics* 'employed)
in the wonderful notation your "independent experts" have cooked up?
Why:
String slot_access = "statistics." + type.toString();
System.library.greenspun.functions_that_begin_with_e.eval(slot_access);
:)
.
- References:
- Re: Symbol clashes: how to avoid them. Part 2
- From: Lars Rune Nøstdal
- Re: Symbol clashes: how to avoid them. Part 2
- From: budden
- Re: Symbol clashes: how to avoid them. Part 2
- From: Tamas K Papp
- Re: Symbol clashes: how to avoid them. Part 2
- Prev by Date: Re: Symbol clashes: how to avoid them. Part 2
- Next by Date: Re: Symbol clashes: how to avoid them. Part 2
- Previous by thread: Re: Symbol clashes: how to avoid them. Part 2
- Next by thread: Re: Symbol clashes: how to avoid them. Part 2
- Index(es):