Show
Ignore:
Timestamp:
08/11/07 04:53:46 (16 months ago)
Author:
krobillard
Message:

Removed slice! datatype - series now have an end.
Added slice test.
ur_makeBinary() now takes pointer argument.
Fixed bug in _makeComponent().
Fixed compiler warnings. Minor optimization to if/.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/thune/thread_safe/doc/UserManual

    r432 r450  
    8989set-select!  :obj/x :my-block/2 
    9090lit-select!  'obj/x 'my-block/2 
    91 slice! 
    9291time!        10:02 -0:0:32.08 
    9392context! 
     
    125124 
    126125 
     126Binary 
     127------ 
     128 
     129A binary value references a series of bytes. 
     130 
     131:: 
     132 
     133     #{0000ff01} 
     134     #{0000 ff01} 
     135     #{68656C6C6F}     ; "hello" as binary 
     136 
     137 
    127138Strings 
    128139------- 
     
    138149   {This string 
    139150   spans multiple lines.} 
    140  
    141  
    142 Slice 
    143 ----- 
    144  
    145 A range within a binary!, string!, or block! can be represented with a slice. 
    146  
    147 :: 
    148  
    149     "Hello world" :s 
    150     slice! s make .                  ; "Hello world" 
    151     slice! s next dup 4 skip make .  ; "ello" 
    152  
    153 To move the start of the slice use *prev* & *next*, as with a series. 
    154 To move the end of the slice use *slice.prev* & *slice.next*. 
    155151 
    156152 
     
    455451next        (ser -- ser)            Increment start of series. 
    456452skip        (ser n -- ser)          Increment start of series by **n**. 
     453slice_      (ser end -- slice)      Slice series. 
     454slice?      (ser end -- slice)      True if series is a slice. 
    457455slice.prev  (slice -- slice)        Decrement end of slice. 
    458456slice.next  (slice -- slice)        Increment end of slice. 
     
    631629 
    632630 
     631slice 
     632----- 
     633 
     634The slice word is used to control the slice range of a series value. 
     635 
     636:: 
     637 
     638    "Hello world" :s 
     639    s 2,6 slice .          ; "ello" 
     640    s -2 slice .           ; ""Hello wor" 
     641 
     642 
     643To move the start of a series by one, use *prev* & *next*. 
     644To move the end of a series by one, use *slice.prev* & *slice.next*. 
     645 
     646 
    633647change 
    634648------