Changeset 35626 in project


Ignore:
Timestamp:
06/20/18 21:17:34 (3 months ago)
Author:
sjamaan
Message:

Add defstruct to eggref/5

File:
1 copied

Legend:

Unmodified
Added
Removed
  • wiki/eggref/5/defstruct

    r35612 r35626  
    2929
    3030<enscript highlight="scheme">
    31 (require-extension defstruct)
     31(import defstruct)
    3232
    3333(defstruct point x y)
     
    5050</enscript>
    5151
    52 On Chicken 4 and higher, there are also two procedures {{update-STRUCTNAME}}
    53 and {{set-STRUCTNAME!}} defined for functionally and destructively updating
    54 selected values in an existing record:
     52There are also two procedures {{update-STRUCTNAME}} and
     53{{set-STRUCTNAME!}} defined for functionally and destructively
     54updating selected values in an existing record:
    5555
    5656<enscript highlight="scheme">
     
    6767</enscript>
    6868
    69 Additionally, there are two conversion procedures for converting to
    70 and from alists, {{STRUCTNAME->alist}} and {{alist->STRUCTNAME}}:
     69Finally, there are two conversion procedures for converting to and
     70from alists, {{STRUCTNAME->alist}} and {{alist->STRUCTNAME}}:
    7171
    7272<enscript highlight="scheme">
     
    8282=== Bugs and limitations
    8383
     84This macro is unhygienic which, while resulting in concise syntax, has
     85some drawbacks:
     86
    8487* Just like with {{define-record}} you cannot use field names ending with {{-set!}} if you also have a similar field name not ending with {{-set!}}.
    85 * Just like with {{define-record}} you should avoid defining record types with a name that is a prefix of another record type's name.
     88* Just like with {{define-record}} you should avoid defining record types with a name that is a prefix of another record type's name in the same module, because that might cause naming clashes.
     89* For the same reason, you should avoid defining record types named {{make}} or {{update}}.
    8690* You cannot use a field named {{>alist}}.
    87 * You should avoid defining record types named {{make}} or {{update}}.
    8891
    8992=== License
     
    9194  Copyright (c) 2005, Dorai Sitaram
    9295  Copyright (c) 2005, Felix Winkelmann (Chicken port)
    93   Copyright (c) 2008-2010, Peter Bex (Hygienic Chicken port + extensions)
     96  Copyright (c) 2008-2018, Peter Bex (Hygienic Chicken port + extensions)
    9497  All rights reserved.
    9598 
Note: See TracChangeset for help on using the changeset viewer.