Changeset 8882 in project


Ignore:
Timestamp:
02/25/08 00:01:34 (12 years ago)
Author:
sjamaan
Message:

Change example syntax

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/c3

    r8881 r8882  
    3636<example>
    3737<init>(use c3)</init>
     38<expr>;; by Michele Simionato
    3839
    39 <expr>;; by Michele Simionato</expr>
     40(define O <object>)
    4041
    41 <expr>(define O <object>)</expr>
     42;; first example
     43(define-class F (O) ())
     44(define-class E (O) ())
     45(define-class D (O) ())
     46(define-class C (D F) ())
     47(define-class B (D E) ())
     48(define-class A (B C) ())
    4249
    43 <expr>;; first example</expr>
    44 <expr>(define-class F (O) ())</expr>
    45 <expr>(define-class E (O) ())</expr>
    46 <expr>(define-class D (O) ())</expr>
    47 <expr>(define-class C (D F) ())</expr>
    48 <expr>(define-class B (D E) ())</expr>
    49 <expr>(define-class A (B C) ())</expr>
     50; with CLOS:
     51(class-cpl A)
     52(A B C D F E object top)
    5053
    51 <expr>; with CLOS:</expr>
    52 <expr>(class-cpl A)</expr>
    53 <result>(A B C D F E object top)</result>
    54 
    55 <expr>; with C3:</expr>
    56 <expr>(class-cpl A)</expr>
    57 <result>(A B C D E F object top) ; E <-> F</result>
     54; with C3:
     55(class-cpl A)
     56(A B C D E F object top) ; E <-> F</expr>
    5857</example>
    5958
    6059<example>
    6160<init>(use c3)</init>
     61<expr>;; second example
     62(define-class F (O) ())
     63(define-class E (O) ())
     64(define-class D (O) ())
     65(define-class C (D F) ())
     66(define-class B (E D) ())
     67(define-class A (B C) ())
    6268
    63 <expr>;; second example</expr>
    64 <expr>(define-class F (O) ())</expr>
    65 <expr>(define-class E (O) ())</expr>
    66 <expr>(define-class D (O) ())</expr>
    67 <expr>(define-class C (D F) ())</expr>
    68 <expr>(define-class B (E D) ())</expr>
    69 <expr>(define-class A (B C) ())</expr>
     69; with CLOS:
     70(class-cpl A)
     71(A B E C D F object top)
    7072
    71 <expr>; with CLOS:</expr>
    72 <expr>(class-cpl A)</expr>
    73 <result>(A B E C D F object top)</result>
    74 
    75 <expr>; with C3:</expr>
    76 <expr>(class-cpl A)</expr>
    77 <result>(A B E C D F object top) ; identical</result>
     73; with C3:
     74(class-cpl A)
     75(A B E C D F object top) ; identical</expr>
    7876</example>
    7977
    8078<example>
    8179<init>(use c3)</init>
     80<expr>;; Pedroni's example
     81(define-class A(O) ())
     82(define-class B(O) ())
     83(define-class C(O) ())
     84(define-class D(O) ())
     85(define-class E(O) ())
     86(define-class K1(A B C) ())
     87(define-class K2(D B E) ())
     88(define-class K3(D A) ())
     89(define-class Z(K1 K2 K3) ())
    8290
    83 <expr>;; Pedroni's example</expr>
    84 <expr>(define-class A(O) ())</expr>
    85 <expr>(define-class B(O) ())</expr>
    86 <expr>(define-class C(O) ())</expr>
    87 <expr>(define-class D(O) ())</expr>
    88 <expr>(define-class E(O) ())</expr>
    89 <expr>(define-class K1(A B C) ())</expr>
    90 <expr>(define-class K2(D B E) ())</expr>
    91 <expr>(define-class K3(D A) ())</expr>
    92 <expr>(define-class Z(K1 K2 K3) ())</expr>
     91; with CLOS:
     92(class-cpl Z)
     93(Z K1 K2 K3 D A B E C object top)
    9394
    94 <expr>; with CLOS:</expr>
    95 <expr>(class-cpl Z)</expr>
    96 <result>(Z K1 K2 K3 D A B E C object top)</result>
    97 
    98 <expr>; with C3:</expr>
    99 <expr>(class-cpl Z)</expr>
    100 <result>(Z K1 K2 K3 D A B C E object top) ; E <-> C</result>
     95; with C3:
     96(class-cpl Z)
     97(Z K1 K2 K3 D A B C E object top) ; E <-> C</expr>
    10198</example>
    10299
Note: See TracChangeset for help on using the changeset viewer.