Re: Symbol clashes: how to avoid them. Part 2
- From: budden <budden01@xxxxxxxxxx>
- Date: Fri, 31 Oct 2008 14:14:35 -0700 (PDT)
Oh, how I'm tired. Mixed everything. Pascal example would read as:
type PVariant = ^variant;
type statistics_slot_names = (unemployed, employed, total);
type statistics = record
lispy_slots : array[statistics_slot_names] of pvariant;
function slot_value(slot_name:statistics_slot_names); { returns a
pointer to slot }
end;
function
statistics.slot_value(slot_name:statistics_slot_names):Pvariant;
begin result:=lispy_slots[slot_name]; end;
If you use OO features, you might make the function virtual. Or you
make this function
dispatched via a dispatch table. Anyway, nothing unique. What makes
lisp powerful is:
1. GC (= safety)
2. defmacro, eval-when (= extensible compiler)
3. Native code compilation at runtime
Not an s-expressions.
.
- 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
- From: budden
- 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: Is it a bad sign...
- 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):