guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A couple of questions about goops method parameters


From: Taylan Ulrich Bayirli/Kammer
Subject: Re: A couple of questions about goops method parameters
Date: Fri, 05 Sep 2014 23:53:18 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Marko Rauhamaa <address@hidden> writes:

> Dynamic programming languages lack a true, efficient dot notation.

If with a "true, efficient dot notation" you mean for example C structs,
then records fill that role except for using accessor procedures instead
of syntax.

(Under the right conditions, usage of records could compile to direct
O(1) memory access (pointer+offset), just like usage of vectors.  Arrays
and structs in C are in direct analogy to vectors and records in Scheme;
the only difference being Scheme's general requirement of type-checks.)

Though after pondering a bit I realized that it indeed seems impossible
to compile "(.bar foo)" (could result from "foo[.bar]" via SRFI-105)
into the correct memory offset, if there are multiple record types each
with a '.bar' field, because it's not statically known which record type
'foo' has.  Maybe that's exactly what you meant.

Taylan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]