Ignore:
Timestamp:
01/29/09 21:14:21 (13 years ago)
Author:
Kon Lovett
Message:

manifest : added tests/lolevel-tests.scm
lolevel.scm : added local argument check procs, mvd 'C_pointer_to_object' to "chicken.h", made tagged-pointer a "pointer object", added 'pointer-like?' predicate, added block checks to 'move-memory!', combined like defines, 'align-to-word' takes integers & not numbers, use of common errmsgs, added layout comments, chgd use of '#+' to 'cond-expand', added 'record-instance' specific procs
extras.scm : use of '##sys#write-char-0' since types known, use of '(void)' instead of '(##core#undefined)'
chicken.h : added 'C_pointer_to_object' since used by a compiler rewrite
csi.scm : use of '(void)' instead of '(##core#undefined)'
manual/Unit lolevel : added discussion of "pointer" vs. "pointer-like', doc for new procs
manual/Data representation : no real change, going to expand
posixunix.scm : use of '(void)' instead of '(##core#undefined)'
support.scm : use of '(void)' instead of '(##core#undefined)'
scheduler.scm : use of '(void)' instead of '(##core#undefined)'
posixwin.scm : use of '(void)' instead of '(##core#undefined)'
tests/lolevel-tests.scm, tests/runtests.sh : added some Unit lolevel tests
srfi-18.scm : use of '(void)' instead of '(##core#undefined)'
srfi-4.scm : use of '##sys#write-char-0' since types known
tcp.scm : use of '(void)' instead of '(##core#undefined)'
eval.scm : use of '(void)' instead of '(##core#undefined)'
data-structures.scm : use of '(void)' instead of '(##core#undefined)'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chicken/branches/chicken-3/manual/Unit lolevel

    r12553 r13134  
    1212This unit uses the {{srfi-4}} and {{extras}} units.
    1313
     14
     15
    1416=== Foreign pointers
    1517
     18The abstract class of pointers is divided into 2 major categories: {{pointer
     19objects}} and {{pointer-like objects}}.
     20
     21A {{pointer object}} is a foreign pointer object or a tagged foreign pointer
     22object (see {{Tagged pointers}}).
     23
     24A {{pointer-like object}} may be a closure, port, locative (see {{Locatives}},
     25or a {{pointer object}}.
     26
     27SWIG pointers are currently second class citizens due to "bitrot" in the SWIG
     28Chicken translator. While they qualify as a {{c-pointer}} for foreign lambda
     29argument conversion they are not supported by the foreign pointer operations.
    1630
    1731
     
    2842 [procedure] (allocate BYTES)
    2943
    30 Returns a pointer to a freshly allocated region of static memory.
     44Returns a foreign pointer object to a freshly allocated region of static
     45memory.
     46
    3147This procedure could be defined as follows:
    3248
     
    4056 [procedure] (free POINTER)
    4157
    42 Frees the memory pointed to by {{POINTER}}.  This procedure could
    43 be defined as follows:
    44 
    45 <enscript highlight=scheme>
    46 (define free (foreign-lambda c-pointer "free" integer))
     58Frees the memory pointed to by {{POINTER}}.
     59
     60This procedure could be defined as follows:
     61
     62<enscript highlight=scheme>
     63(define free (foreign-lambda void "free" c-pointer))
    4764</enscript>
    4865
     
    5774==== null-pointer?
    5875
    59  [procedure] (null-pointer? PTR)
    60 
    61 Returns {{#t}} if {{PTR}} contains a {{NULL}} pointer,
     76 [procedure] (null-pointer? PTR*)
     77
     78Returns {{#t}} if the pointer-like object {{PTR*}} contains a {{NULL}} pointer,
    6279or {{#f}} otherwise.
    6380
     
    6784 [procedure] (object->pointer X)
    6885
    69 Returns a pointer pointing to the Scheme object X, which should be a
    70 non-immediate object.  Note that data in the garbage collected heap
    71 moves during garbage collection.
    72 
     86Returns a foreign pointer object pointing to the Scheme object X, which should
     87be a non-immediate object. ("foreign" here is a bit of a misnomer.)
     88
     89Note that data in the garbage collected heap moves during garbage collection.
     90
     91
     92==== pointer->object
     93
     94 [procedure] (pointer->object PTR)
     95
     96Returns the Scheme object pointed to by the pointer object {{PTR}}.
     97
     98Whether the {{PTR}} actually points to a Scheme object is not guaranteed. Use
     99at your own risk.
    73100
    74101==== pointer?
     
    76103 [procedure] (pointer? X)
    77104
    78 Returns {{#t}} if {{X}} is a foreign pointer object, and
    79 {{#f}} otherwise.
     105Returns {{#t}} if {{X}} is a pointer object, or {{#f}} otherwise.
     106
     107
     108==== pointer-like?
     109
     110 [procedure] (pointer-like? X)
     111
     112Returns {{#t}} if {{X}} is a pointer-like object, or {{#f}} otherwise.
     113
    80114
    81115==== pointer=?
    82116
    83  [procedure] (pointer=? PTR1 PTR2)
    84 
    85 Returns {{#t}} if the pointer-like objects {{PTR1}} and {{PTR2}} point
    86 to the same address.
    87 
     117 [procedure] (pointer=? PTR*1 PTR*2)
     118
     119Returns {{#t}} if the pointer-like objects {{PTR*1}} and {{PTR*2}} point
     120to the same address, or {{#f}} otherwise.
    88121
    89122
    90123==== pointer->address
    91124
    92  [procedure] (pointer->address PTR)
    93 
    94 Returns the address, to which the pointer {{PTR}} points.
    95 
    96 
    97 ==== pointer->object
    98 
    99  [procedure] (pointer->object PTR)
    100 
    101 Returns the Scheme object pointed to by the pointer {{PTR}}.
     125 [procedure] (pointer->address PTR*)
     126
     127Returns the address, to which the pointer-like object {{PTR*}} points.
    102128
    103129
    104130==== pointer-offset
    105131
    106  [procedure] (pointer-offset PTR N)
    107 
    108 Returns a new pointer representing the pointer {{PTR}} increased
    109 by {{N}}.
    110 
     132 [procedure] (pointer-offset PTR* N)
     133
     134Returns a new foreign pointer object representing the pointer-like object
     135{{PTR*}} address value increased by the byte-offset {{N}}.
     136
     137Use of anything other than a pointer object as an argument is questionable.
     138
     139
     140==== align-to-word
     141
     142 [procedure] (align-to-word PTR*-OR-INT)
     143
     144Accepts either a pointer-like object or an integer as the argument and returns
     145a new foreign pointer or integer aligned to the native word size of the host
     146platform.
     147
     148Use of anything other than an integer or pointer object as an argument is
     149questionable.
     150
     151
     152
     153=== SRFI-4 Foreign pointers
     154
     155These procedures actually accept a pointer-like object as the {{PTR}} argument.
     156However, as usual, use of anything other than a pointer object is questionable.
    111157
    112158==== pointer-u8-ref
     
    230276
    231277
    232 ==== align-to-word
    233 
    234  [procedure] (align-to-word PTR-OR-INT)
    235 
    236 Accepts either a machine pointer or an integer as argument and returns
    237 a new pointer or integer aligned to the native word size of the host
    238 platform.
    239 
    240 
    241 
    242 
    243278
    244279=== Tagged pointers
     
    247282
    248283
    249 
    250284==== tag-pointer
    251285
    252  [procedure] (tag-pointer PTR TAG)
    253 
    254 Creates a new tagged pointer object from the foreign pointer {{PTR}} with the
    255 tag {{TAG}}, which may an arbitrary Scheme object.
    256 
     286 [procedure] (tag-pointer PTR* TAG)
     287
     288Creates a new tagged foreign pointer object from the pointer-like object
     289{{PTR*}} with the tag {{TAG}}, which may an arbitrary Scheme object.
     290
     291Use of anything other than a pointer object is questionable.
    257292
    258293==== tagged-pointer?
    259294
    260  [procedure] (tagged-pointer? X TAG)
    261 
    262 Returns {{#t}}, if {{X}} is a tagged pointer object with the tag {{TAG}}
    263 (using an {{eq?}} comparison), or {{#f}} otherwise.
     295 [procedure] (tagged-pointer? X [TAG])
     296
     297Returns {{#t}} if {{X}} is a tagged foreign pointer object, or {{#f}} otherwise.
     298
     299Further, returns {{#t}} when {{X}} has the optional tag {{TAG}} (using an
     300{{equal?}} comparison), or {{#f}} otherwise.
    264301
    265302
    266303==== pointer-tag
    267304
    268  [procedure] (pointer-tag PTR)
    269 
    270 If {{PTR}} is a tagged pointer object, its tag is returned. If {{PTR}} is a normal,
    271 untagged foreign pointer object {{#f}} is returned. Otherwise an error is signalled.
    272 
    273 
     305 [procedure] (pointer-tag PTR*)
     306
     307If {{PTR}} is a tagged foreign pointer object, its tag is returned. If {{PTR*}}
     308is any other kind of pointer-like object {{#f}} is returned. Otherwise an
     309error is signalled.
     310
     311
     312
     313=== Locatives
     314
     315
     316A ''locative'' is an object that points to an element of a containing object,
     317much like a ''pointer'' in low-level, imperative programming languages like ''C''. The element can
     318be accessed and changed indirectly, by performing access or change operations
     319on the locative. The container object can be computed by calling the
     320{{location->object}} procedure.
     321
     322Locatives may be passed to foreign procedures that expect pointer arguments.
     323The effect of creating locatives for evicted data (see {{object-evict}}) is undefined.
     324
     325
     326==== make-locative
     327
     328 [procedure] (make-locative OBJ [INDEX])
     329
     330Creates a locative that refers to the element of the non-immediate object
     331{{OBJ}} at position {{INDEX}}. {{OBJ}} may be a vector, pair, string, blob,
     332SRFI-4 number-vector, or record structure. {{INDEX}} should be a fixnum.
     333{{INDEX}} defaults to 0.
     334
     335
     336==== make-weak-locative
     337
     338 [procedure] (make-weak-locative OBJ [INDEX])
     339
     340Creates a ''weak'' locative. Even though the locative refers to an element of a container object,
     341the container object will still be reclaimed by garbage collection if no other references
     342to it exist.
     343
     344
     345==== locative?
     346
     347 [procedure] (locative? X)
     348
     349Returns {{#t}} if {{X}} is a locative, or {{#f}} otherwise.
     350
     351
     352==== locative-ref
     353
     354 [procedure] (locative-ref LOC)
     355
     356Returns the element to which the locative {{LOC}} refers. If the containing
     357object has been reclaimed by garbage collection, an error is signalled.
     358
     359 (locative-ref (make-locative "abc" 1)) ==> #\b
     360
     361==== locative-set!
     362
     363 [procedure] (locative-set! LOC X)
     364 [procedure] (set! (locative-ref LOC) X)
     365
     366Changes the element to which the locative {{LOC}} refers to {{X}}.
     367If the containing
     368object has been reclaimed by garbage collection, an error is signalled.
     369
     370
     371==== locative->object
     372
     373 [procedure] (locative->object LOC)
     374
     375Returns the object that contains the element referred to by {{LOC}} or
     376{{#f}} if the container has been reclaimed by garbage collection.
     377
     378 (locative->object (make-locative "abc" 1)) ==> "abc"
    274379
    275380
     
    278383
    279384
    280 
    281 
    282385==== extend-procedure
    283386
    284387 [procedure] (extend-procedure PROCEDURE X)
    285388
    286 Returns a copy of the procedure {{PROCEDURE}} which contains an
    287 additional data slot initialized to {{X}}. If {{PROCEDURE}}
    288 is already an extended procedure, then its data slot is changed to
    289 contain {{X}} and the same procedure is returned.
     389Returns a copy of the procedure {{PROCEDURE}} which contains an additional data
     390slot initialized to {{X}}. If {{PROCEDURE}} is already an extended procedure,
     391then its data slot is changed to contain {{X}} and the same procedure is
     392returned. Signals an error when {{PROCEDURE}} is not a procedure.
    290393
    291394
     
    302405 [procedure] (procedure-data PROCEDURE)
    303406
    304 Returns the data object contained in the extended procedure {{PROCEDURE}},
    305 or {{#f}} if it is not an extended procedure.
     407Returns the data object contained in the extended procedure {{PROCEDURE}}, or
     408{{#f}} if it is not an extended procedure.
    306409
    307410
     
    310413 [procedure] (set-procedure-data! PROCEDURE X)
    311414
    312 Changes the data object contained in the extended procedure
    313 {{PROCEDURE}} to {{X}}.
     415Changes the data object contained in the extended procedure {{PROCEDURE}} to
     416{{X}}. Signals an error when {{PROCEDURE}} is not an extended procedure.
    314417
    315418<enscript highlight=scheme>
     
    329432
    330433
    331 
    332 
    333434==== object-evict
    334435
    335436 [procedure] (object-evict X [ALLOCATOR])
    336437
    337 Copies the object {{X}} recursively into the memory pointed
    338 to by the foreign pointer object returned by {{ALLOCATOR}},
    339 which should be a procedure of a single argument (the number of bytes
    340 to allocate). The freshly copied object is returned.  This facility
    341 allows moving arbitrary objects into static memory, but care should be
    342 taken when mutating evicted data: setting slots in evicted vector-like
    343 objects to non-evicted data is not allowed. It '''is''' possible to
     438Copies the object {{X}} recursively into the memory pointed to by the foreign
     439pointer object returned by {{ALLOCATOR}}, which should be a procedure of a
     440single argument (the number of bytes to allocate). The freshly copied object is
     441returned.
     442
     443This facility allows moving arbitrary objects into static memory, but care
     444should be taken when mutating evicted data: setting slots in evicted
     445vector-like objects to non-evicted data is not allowed. It '''is''' possible to
    344446set characters/bytes in evicted strings or byte-vectors, though.  It is
    345 advisable '''not''' to evict ports, because they might be mutated by
    346 certain file-operations.  {{object-evict}} is able to handle circular and
    347 shared structures, but evicted symbols are no longer unique: a fresh
    348 copy of the symbol is created, so
     447advisable '''not''' to evict ports, because they might be mutated by certain
     448file-operations.  {{object-evict}} is able to handle circular and shared
     449structures, but evicted symbols are no longer unique: a fresh copy of the
     450symbol is created, so
    349451
    350452<enscript highlight=scheme>
     
    362464==== object-evict-to-location
    363465
    364  [procedure] (object-evict-to-location X PTR [LIMIT])
     466 [procedure] (object-evict-to-location X PTR* [LIMIT])
    365467
    366468As {{object-evict}} but moves the object at the address pointed to by
    367 the machine pointer {{PTR}}. If the number of copied bytes exceeds
     469the pointer-like object {{PTR*}}. If the number of copied bytes exceeds
    368470the optional {{LIMIT}} then an error is signalled (specifically a composite
    369471condition of types {{exn}} and {{evict}}. The latter provides
     
    372474free address after the evicted object.
    373475
     476Use of anything other than a pointer object as the {{PTR*}} argument is
     477questionable.
    374478
    375479==== object-evicted?
     
    377481 [procedure] (object-evicted? X)
    378482
    379 Returns {{#t}} if {{X}} is a non-immediate evicted data object,
    380 or {{#f}} otherwise.
    381 
    382 
    383 ==== object-size
    384 
    385  [procedure] (object-size X)
    386 
    387 Returns the number of bytes that would be needed to evict the data
    388 object {{X}}.
     483Returns {{#t}} if {{X}} is a non-immediate evicted data object, or {{#f}}
     484otherwise.
    389485
    390486
     
    403499 [procedure] (object-unevict X [FULL])
    404500
    405 Copies the object {{X}} and nested objects back into the normal
    406 Scheme heap.  Symbols are re-interned into the symbol table. Strings
    407 and byte-vectors are '''not''' copied, unless {{FULL}} is given and
    408 not {{#f}}.
    409 
    410 
    411 
    412 
    413 
    414 === Locatives
    415 
    416 
    417 A ''locative'' is an object that points to an element of a containing object,
    418 much like a ''pointer'' in low-level, imperative programming languages like ''C''. The element can
    419 be accessed and changed indirectly, by performing access or change operations
    420 on the locative. The container object can be computed by calling the
    421 {{location->object}} procedure.
    422 
    423 Locatives may be passed to foreign procedures that expect pointer arguments.
    424 The effect of creating locatives for evicted data (see {{object-evict}}) is undefined.
    425 
    426 
    427 
    428 ==== make-locative
    429 
    430  [procedure] (make-locative EXP [INDEX])
    431 
    432 Creates a locative that refers to the element of the non-immediate object {{EXP}}
    433 at position {{INDEX}}. {{EXP}} may be a vector, pair, string, blob,
    434 SRFI-4 number-vector, or record. {{INDEX}} should be a fixnum. {{INDEX}} defaults to 0.
    435 
    436 
    437 ==== make-weak-locative
    438 
    439  [procedure] (make-weak-locative EXP [INDEX])
    440 
    441 Creates a ''weak'' locative. Even though the locative refers to an element of a container object,
    442 the container object will still be reclaimed by garbage collection if no other references
    443 to it exist.
    444 
    445 
    446 ==== locative?
    447 
    448  [procedure] (locative? X)
    449 
    450 Returns {{#t}} if {{X}} is a locative, or {{#f}} otherwise.
    451 
    452 
    453 ==== locative-ref
    454 
    455  [procedure] (locative-ref LOC)
    456 
    457 Returns the element to which the locative {{LOC}} refers. If the containing
    458 object has been reclaimed by garbage collection, an error is signalled.
    459 
    460  (locative-ref (make-locative "abc" 1)) ==> #\b
    461 
    462 ==== locative-set!
    463 
    464  [procedure] (locative-set! LOC X)
    465  [procedure] (set! (locative-ref LOC) X)
    466 
    467 Changes the element to which the locative {{LOC}} refers to {{X}}.
    468 If the containing
    469 object has been reclaimed by garbage collection, an error is signalled.
    470 
    471 
    472 ==== locative->object
    473 
    474  [procedure] (locative->object LOC)
    475 
    476 Returns the object that contains the element referred to by {{LOC}} or
    477 {{#f}} if the container has been reclaimed by garbage collection.
    478 
    479  (locative->object (make-locative "abc" 1)) ==> "abc"
    480 
     501Copies the object {{X}} and nested objects back into the normal Scheme heap.
     502Symbols are re-interned into the symbol table. Strings and byte-vectors are
     503'''not''' copied, unless {{FULL}} is given and not {{#f}}.
     504
     505
     506==== object-size
     507
     508 [procedure] (object-size X)
     509
     510Returns the number of bytes that would be needed to evict the data object
     511{{X}}.
    481512
    482513
    483514
    484515=== Accessing toplevel variables
    485 
    486 
    487516
    488517
     
    516545
    517546
    518 
    519 
    520547=== Low-level data access
    521548
     
    525552 [procedure] (block-ref BLOCK INDEX)
    526553
    527 Returns the contents of the {{INDEX}}th slot of the object
    528 {{BLOCK}}.  {{BLOCK}} may be a vector, record structure,
    529 pair or symbol.
     554Returns the contents of the {{INDEX}}th slot of the object {{BLOCK}}. {{BLOCK}}
     555may be a vector, record structure, pair or symbol.
    530556
    531557
     
    535561 [procedure] (set! (block-ref BLOCK INDEX) X)
    536562
    537 Sets the contents of the {{INDEX}}th slot of the object
    538 {{BLOCK}} to the value of {{X}}.  {{BLOCK}} may be a
    539 vector, record structure, pair or symbol.
     563Sets the contents of the {{INDEX}}th slot of the object {{BLOCK}} to the value
     564of {{X}}.  {{BLOCK}} may be a vector, record structure, pair or symbol.
     565
     566
     567==== number-of-bytes
     568
     569 [procedure] (number-of-bytes BLOCK)
     570
     571Returns the number of bytes that the object {{BLOCK}} contains. {{BLOCK}} may
     572be any non-immediate value.
     573
     574
     575==== number-of-slots
     576
     577 [procedure] (number-of-slots BLOCK)
     578
     579Returns the number of slots that the object {{BLOCK}} contains.
     580{{BLOCK}} may be a vector, record structure, pair or symbol.
    540581
    541582
     
    544585 [procedure] (object-copy X)
    545586
    546 Copies {{X}} recursively and returns the fresh copy. Objects
    547 allocated in static memory are copied back into garbage collected storage.
     587Copies {{X}} recursively and returns the fresh copy. Objects allocated in
     588static memory are copied back into garbage collected storage.
     589
     590
     591==== move-memory!
     592
     593 [procedure] (move-memory! FROM TO [BYTES [FROM-OFFSET [TO-OFFSET]])
     594
     595Copies {{BYTES}} bytes of memory from {{FROM}} to {{TO}}. {{FROM}} and {{TO}}
     596may be strings, blobs, SRFI-4 number-vectors (see: @ref{Unit srfi-4}), memory
     597mapped files, foreign pointers (as obtained from a call to {{foreign-lambda}},
     598for example), tagged-pointers or locatives. if {{BYTES}} is not given and the
     599size of the source or destination operand is known then the maximal number of
     600bytes will be copied. Moving memory to the storage returned by locatives will
     601cause havoc, if the locative refers to containers of non-immediate data, like
     602vectors or pairs.
     603
     604The additional fourth and fifth argument specify starting offsets (in bytes)
     605for the source and destination arguments.
     606
     607Signals an error if any of the above constraints is violated.
     608
     609
     610
     611=== Record instance
    548612
    549613
     
    552616 [procedure] (make-record-instance SYMBOL ARG1 ...)
    553617
    554 Returns a new instance of the record type {{SYMBOL}}, with its
    555 slots initialized to {{ARG1 ...}}.  To illustrate:
     618Returns a new instance of a record structure of type {{SYMBOL}}, with its
     619slots initialized to {{ARG1 ...}}.
     620
     621To illustrate:
    556622
    557623<enscript highlight=scheme>
     
    575641
    576642
    577 ==== move-memory!
    578 
    579  [procedure] (move-memory! FROM TO [BYTES [FROM-OFFSET [TO-OFFSET]])
    580 
    581 Copies {{BYTES}} bytes of memory from {{FROM}} to {{TO}}.
    582 {{FROM}} and {{TO}} may be strings, primitive byte-vectors,
    583 SRFI-4 byte-vectors (see: @ref{Unit srfi-4}), memory mapped files, foreign
    584 pointers (as obtained from a call to {{foreign-lambda}}, for
    585 example) or locatives. if {{BYTES}} is not given and the size of the source
    586 or destination operand is known then the maximal number of bytes will
    587 be copied. Moving memory to the storage returned by locatives will cause havoc,
    588 if the locative refers to containers of non-immediate data, like vectors
    589 or pairs.
    590 
    591 The additional fourth and fifth argument specify starting offsets
    592 (in bytes) for the source and destination arguments.
    593 
    594 
    595 ==== number-of-bytes
    596 
    597  [procedure] (number-of-bytes BLOCK)
    598 
    599 Returns the number of bytes that the object {{BLOCK}} contains.
    600 {{BLOCK}} may be any non-immediate value.
    601 
    602 
    603 ==== number-of-slots
    604 
    605  [procedure] (number-of-slots BLOCK)
    606 
    607 Returns the number of slots that the object {{BLOCK}} contains.
    608 {{BLOCK}} may be a vector, record structure, pair or symbol.
    609 
    610 
    611643==== record-instance?
    612644
    613  [procedure] (record-instance? X)
    614 
    615 Returns {{#t}} if {{X}} is an instance of a record type.
    616 See also: {{make-record-instance}}.
     645 [procedure] (record-instance? X [SYMBOL])
     646
     647Returns {{#t}} if {{X}} is a record structure, or {{#f}} otherwise.
     648
     649Further, returns {{#t}} if {{X}} is of type {{SYMBOL}}, or {{#f}} otherwise.
     650
     651
     652==== record-instance-type
     653
     654 [procedure] (record-instance-type RECORD)
     655
     656Returns type symbol of the record structure {{RECORD}}. Signals an error if
     657{{RECORD}} is not a record structure.
     658
     659
     660==== record-instance-length
     661
     662 [procedure] (record-instance-length RECORD)
     663
     664Returns number of slots for the record structure {{RECORD}}. The
     665record-instance type is not counted. Signals an error if
     666{{RECORD}} is not a record structure.
     667
     668
     669==== record-instance-slot
     670
     671 [procedure] (record-instance-slot RECORD INDEX)
     672
     673Returns the contents of the {{INDEX}}th slot of the record structure
     674{{RECORD}}. The slot index range is the open interval (([0
     675record-instance-length)}}. Signals an error if {{RECORD}} is not a record
     676structure.
     677
     678
     679==== record-instance-slot-set!
     680
     681 [procedure] (record-instance-slot-set! RECORD INDEX X)
     682 [procedure] (set! (record-instance-slot RECORD INDEX) X)
     683
     684Sets the {{INDEX}}th slot of the record structure {{RECORD}} to {{X}}. The slot
     685index range is the open interval (([0 record-instance-length)}}. Signals an
     686error if {{RECORD}} is not a record structure.
    617687
    618688
    619689==== record->vector
    620690
    621  [procedure] (record->vector BLOCK)
    622 
    623 Returns a new vector with the type and the elements of the record {{BLOCK}}.
     691 [procedure] (record->vector RECORD)
     692
     693Returns a new vector with the type and the elements of the record structure
     694{{RECORD}}. Signals an error if {{RECORD}} is not a record structure.
    624695
    625696
     
    632703 [procedure] (set-invalid-procedure-call-handler! PROC)
    633704
    634 Sets an internal hook that is invoked when a call to an object other than a procedure
    635 is executed at runtime. The procedure {{PROC}} will in that case be called
    636 with two arguments: the object being called and a list of the passed arguments.
     705Sets an internal hook that is invoked when a call to an object other than a
     706procedure is executed at runtime. The procedure {{PROC}} will in that case be
     707called with two arguments: the object being called and a list of the passed
     708arguments.
    637709
    638710<enscript highlight=scheme>
     
    655727 [procedure] (unbound-variable-value [X])
    656728
    657 Defines the value that is returned for unbound variables. Normally an error
    658 is signalled, use this procedure to override the check and return {{X}}
    659 instead. To set the default behavior (of signalling an error), call
     729Defines the value that is returned for unbound variables. Normally an error is
     730signalled, use this procedure to override the check and return {{X}} instead.
     731To set the default behavior (of signalling an error), call
    660732{{unbound-variable-value}} with no arguments.
    661733
     
    664736
    665737
    666 
    667 
    668738=== Magic
    669739
     
    673743 [procedure] (object-become! ALIST)
    674744
    675 Changes the identity of the value of the car of each pair in
    676 {{ALIST}} to the value of the cdr. Both values may not be immediate
    677 (i.e. exact integers, characters, booleans or the empty list).
     745Changes the identity of the value of the car of each pair in {{ALIST}} to the
     746value of the cdr. Both values may not be immediate (i.e. exact integers,
     747characters, booleans or the empty list).
    678748
    679749<enscript highlight=scheme>
     
    697767
    698768Replaces the procedure {{OLD}} with the result of calling the one-argument
    699 procedure {{PROC}}. {{PROC}} will receive a copy of {{OLD}} that will
    700 be identical in behaviour to the result of {{PROC}}:
     769procedure {{PROC}}. {{PROC}} will receive a copy of {{OLD}} that will be
     770identical in behaviour to the result of {{PROC}}:
    701771
    702772<enscript highlight=scheme>
Note: See TracChangeset for help on using the changeset viewer.