Hi,
Kevin Ryde <[EMAIL PROTECTED]> writes:
> I'm looking at the code below for my new `make-vtable'. I'm still not
> completely convinced it's a great idea, but it does at least find a
> use in stacks.c, so it can't be all bad!
I find it nice and useful,
I'm looking at the code below for my new `make-vtable'. I'm still not
completely convinced it's a great idea, but it does at least find a
use in stacks.c, so it can't be all bad!
--- struct.c.~1.111.2.6.~ 2007-03-06 11:19:49.0 +1100
+++ struct.c 2007-03-06
Hi,
Kevin Ryde <[EMAIL PROTECTED]> writes:
> Neil Jerram <[EMAIL PROTECTED]> writes:
>>
>> That's a fair point, but IMO Kevin's doc layout allows for it by
>> putting the vtable-vtable stuff last.
>
> It's last because it's the most brain twisting :).
I think it's the right term. ;-)
I agree w
Kevin Ryde <[EMAIL PROTECTED]> writes:
> Is the "ball" example your code? It looks fairly typical (a "colour"
> field in the vtable which is a constant), if the few words introducing
> it give the right sense of what it's meant to be about.
No, not mine. I didn't recall seeing it before, so I a
Neil Jerram <[EMAIL PROTECTED]> writes:
>
> That's a fair point, but IMO Kevin's doc layout allows for it by
> putting the vtable-vtable stuff last.
It's last because it's the most brain twisting :).
Is the "ball" example your code? It looks fairly typical (a "colour"
field in the vtable which i
[EMAIL PROTECTED] (Ludovic Courtès) writes:
> Right, but a "metaclass" is the class of class, i.e., a class (IOW, a
> metaclass is an instance of or a sub-class thereof). So that's
> really two levels.
That's true, but then it's also true that a class is an instance - so
you could say that's ju
Hi,
Neil Jerram <[EMAIL PROTECTED]> writes:
> [EMAIL PROTECTED] (Ludovic Courtès) writes:
>
>> More generally, a three-level architecture like the one you suggest
>> would look fishy. For instance, GOOPS and other CLOS derivatives have
>> and , representing respectively the "base" and "meta"
>>
[EMAIL PROTECTED] (Ludovic Courtès) writes:
> More generally, a three-level architecture like the one you suggest
> would look fishy. For instance, GOOPS and other CLOS derivatives have
> and , representing respectively the "base" and "meta"
> levels, but they have no need for , or
> some such.
as long as you don't want any extra fields in the vtable (which
> is true for scm_stack_type). I thought of that for my make-vtable
> func,
>
> (define make-vtable
> (let ((vtable-vtable #f))
> (lambda (fields tail-size . print)
> (or vtable-
;, `struct-vtable'
> would terminate the "reflective tower" (i.e., its vtable is itself).
Yes, as long as you don't want any extra fields in the vtable (which
is true for scm_stack_type). I thought of that for my make-vtable
func,
(define make-vtable
(let ((vtable-
terminate the "reflective tower" (i.e., its vtable is itself).
Actually, such a `struct-vtable' stealthily appears in
`make-vtable-vtable', under the name of REQUIRED_VTABLE_FIELDS: We could
really have a `struct-vtable' whose layout is REQUIRED_VTABLE_FIELDS and
the
levels, but they have no need for , or
> some such.
The closest I've got to imagining it is that make-vtable-vtable
creates a root, a vtable whose parent vtable is itself. (What I'm not
sure if it's supposed to be the root of a whole heirarchy, or just of
two levels, if you kn
rmal").
I'm not sure the indirection in `scm_init_stacks ()' is needed since it
uses STACK_LAYOUT for both VTABLE and SCM_STACK_TYPE, and `make-struct'
doesn't look at the vtable's vtable anyway (when creating instances of
SCM_STACK_TYPE).
> Perhaps we have an expert lur
[EMAIL PROTECTED] (Ludovic Courtès) writes:
>
> (let* ((vtable (make-vtable-vtable "pr" 0))
> (s1 (make-struct vtable 0 "hello"))
> (s2 (make-struct vtable 0 "hello")))
>;; S1 and S2 are both "regular&
rection: in classic reflective OO terms,
`make-vtable-vtable' returns a "class" object which `make-struct' can
then use to return regular (i.e., non-class) objects. In particular,
this example (from `structs.test') works:
(let* ((vtable (make-vtable-vtable "pr&quo
. Seems hard work for casual users, if you're
not (at first) interested in that second level of "type of type".
How about something like this to just make a vtable from fields and
optional printer func,
(define (make-vtable fields . print)
(apply make-struct (make-vtable
16 matches
Mail list logo