set-nth-unsafe ( elt n seq -- ) (original) (raw)
Generic word contract
Unsafe variant of set-nth that does not perform bounds checks.
USING: accessors alien.c-types kernel math raylib
sequences.private specialized-arrays.instances.raylib.BoneInfo ;
M: BoneInfo-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ BoneInfo set-alien-element ; inline
USING: accessors alien.c-types elf kernel math sequences.private
specialized-arrays.instances.elf.Elf32_Phdr ;
M: Elf32_Phdr-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ Elf32_Phdr set-alien-element ; inline
USING: accessors alien.c-types elf kernel math sequences.private
specialized-arrays.instances.elf.Elf32_Shdr ;
M: Elf32_Shdr-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ Elf32_Shdr set-alien-element ; inline
USING: accessors alien.c-types elf kernel math sequences.private
specialized-arrays.instances.elf.Elf32_Sym ;
M: Elf32_Sym-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ Elf32_Sym set-alien-element ; inline
USING: accessors alien.c-types elf kernel math sequences.private
specialized-arrays.instances.elf.Elf64_Phdr ;
M: Elf64_Phdr-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ Elf64_Phdr set-alien-element ; inline
USING: accessors alien.c-types elf kernel math sequences.private
specialized-arrays.instances.elf.Elf64_Shdr ;
M: Elf64_Shdr-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ Elf64_Shdr set-alien-element ; inline
USING: accessors alien.c-types elf kernel math sequences.private
specialized-arrays.instances.elf.Elf64_Sym ;
M: Elf64_Sym-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ Elf64_Sym set-alien-element ; inline
USING: accessors alien.c-types kernel math raylib
sequences.private specialized-arrays.instances.raylib.Material ;
M: Material-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ Material set-alien-element ; inline
USING: accessors alien.c-types kernel math raylib
sequences.private
specialized-arrays.instances.raylib.MaterialMap ;
M: MaterialMap-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ MaterialMap set-alien-element ; inline
USING: accessors alien.c-types kernel math raylib
sequences.private specialized-arrays.instances.raylib.Matrix ;
M: Matrix-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ Matrix set-alien-element ; inline
USING: accessors alien.c-types kernel math raylib
sequences.private specialized-arrays.instances.raylib.Mesh ;
M: Mesh-array set-nth-unsafe
[ integer>fixnum ] dip underlying>> \ Mesh set-alien-element
; inline
USING: accessors alien.c-types kernel math raylib
sequences.private specialized-arrays.instances.raylib.Vector2 ;
M: Vector2-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ Vector2 set-alien-element ; inline
USING: accessors kernel raylib sequences.private ;
M: Vector2 set-nth-unsafe swap 0 = [ x<< ] [ y<< ] if ;
USING: accessors alien.c-types kernel math raylib
sequences.private specialized-arrays.instances.raylib.Vector3 ;
M: Vector3-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ Vector3 set-alien-element ; inline
USING: accessors combinators kernel raylib sequences.private ;
M: Vector3 set-nth-unsafe
swap { { 0 [ x<< ] } { 1 [ y<< ] } { 2 [ z<< ] } } case ;
USING: accessors combinators kernel raylib sequences.private ;
M: Vector4 set-nth-unsafe
swap
{ { 0 [ x<< ] } { 1 [ y<< ] } { 2 [ z<< ] } { 3 [ w<< ] } }
case ;
USING: arrays kernel math sequences.private ;
M: array set-nth-unsafe [ integer>fixnum ] dip set-array-nth
; inline
USING: bit-arrays bit-arrays.private sequences.private ;
M: bit-array set-nth-unsafe
bit-index [ toggle-bit ] change-nth-unsafe ; inline
USING: accessors alien.c-types benchmark.nbody-simd kernel math
sequences.private
specialized-arrays.instances.benchmark.nbody-simd.body ;
M: body-array set-nth-unsafe
[ integer>fixnum ] dip underlying>> \ body set-alien-element
; inline
USING: accessors alien.c-types gpu.demos.bunny kernel math
sequences.private
specialized-arrays.instances.gpu.demos.bunny.bunny-vertex-struct
;
M: bunny-vertex-struct-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ bunny-vertex-struct set-alien-element ;
inline
USING: alien.accessors byte-arrays kernel math sequences.private
;
M: byte-array set-nth-unsafe
swap integer>fixnum set-alien-unsigned-1 ; inline
USING: accessors alien.c-types kernel math sequences.private
specialized-arrays.instances.alien.c-types.c-string ;
M: c-string-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ c-string set-alien-element ; inline
USING: accessors alien.c-types kernel math.vectors.simd
math.vectors.simd.private sequences.private ;
M: char-16 set-nth-unsafe
[ char boolean>element ] 2dip
underlying>> char set-alien-element ; inline
USING: accessors alien.c-types kernel math sequences.private
specialized-arrays.instances.alien.c-types.char ;
M: char-array set-nth-unsafe
[ integer>fixnum ] dip underlying>> \ char set-alien-element
; inline
USING: grouping.private kernel sequences sequences.private ;
M: chunking set-nth-unsafe group@ 0 swap copy ;
USING: sequences sequences.complex-components sequences.private
;
M: complex-components set-nth-unsafe immutable ;
USING: accessors alien.c-types alien.complex kernel math
sequences.private
specialized-arrays.instances.alien.complex.complex-double ;
M: complex-double-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ complex-double set-alien-element ; inline
USING: accessors alien.c-types alien.complex kernel math
sequences.private
specialized-arrays.instances.alien.complex.complex-float ;
M: complex-float-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ complex-float set-alien-element ; inline
USING: kernel math sequences.complex sequences.complex.private
sequences.private ;
M: complex-sequence set-nth-unsafe
complex@
[ [ real-part ] [ ] [ ] tri* set-nth-unsafe ]
[ [ imaginary-part ] [ 1 + ] [ ] tri* set-nth-unsafe ] 3bi ;
USING: accessors alien.c-types chipmunk.ffi kernel math
sequences.private
specialized-arrays.instances.chipmunk.ffi.cpContact ;
M: cpContact-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ cpContact set-alien-element ; inline
USING: accessors alien.c-types chipmunk.ffi kernel math
sequences.private
specialized-arrays.instances.chipmunk.ffi.cpPolyShapeAxis ;
M: cpPolyShapeAxis-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ cpPolyShapeAxis set-alien-element ; inline
USING: accessors alien.c-types chipmunk.ffi kernel math
sequences.private
specialized-arrays.instances.chipmunk.ffi.cpVect ;
M: cpVect-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ cpVect set-alien-element ; inline
USING: accessors alien.c-types kernel math.vectors.simd
math.vectors.simd.private sequences.private ;
M: double-2 set-nth-unsafe
[ double boolean>element ] 2dip
underlying>> double set-alien-element ; inline
USING: accessors alien.c-types kernel math
math.vectors.simd.cords sequences.private
specialized-arrays.instances.math.vectors.simd.cords.double-4 ;
M: double-4-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ double-4 set-alien-element ; inline
USING: accessors alien.c-types kernel math sequences.private
specialized-arrays.instances.alien.c-types.double ;
M: double-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ double set-alien-element ; inline
USING: accessors alien.c-types kernel macho math
sequences.private specialized-arrays.instances.macho.fat_arch ;
M: fat_arch-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ fat_arch set-alien-element ; inline
USING: accessors alien.c-types fftw.ffi kernel math
sequences.private
specialized-arrays.instances.fftw.ffi.fftw_complex ;
M: fftw_complex-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ fftw_complex set-alien-element ; inline
USING: accessors alien.c-types kernel math math.vectors.simd
sequences.private
specialized-arrays.instances.math.vectors.simd.float-4 ;
M: float-4-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ float-4 set-alien-element ; inline
USING: accessors alien.c-types kernel math.vectors.simd
math.vectors.simd.private sequences.private ;
M: float-4 set-nth-unsafe
[ float boolean>element ] 2dip
underlying>> float set-alien-element ; inline
USING: accessors alien.c-types kernel math sequences.private
specialized-arrays.instances.alien.c-types.float ;
M: float-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ float set-alien-element ; inline
USING: accessors alien.c-types game.loop.benchmark kernel math
sequences.private
specialized-arrays.instances.game.loop.benchmark.game-loop-benchmark
;
M: game-loop-benchmark-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ game-loop-benchmark set-alien-element ;
inline
USING: accessors growable sequences.private ;
M: growable set-nth-unsafe underlying>> set-nth-unsafe ; inline
USING: accessors alien.c-types kernel math math.floats.half
sequences.private
specialized-arrays.instances.math.floats.half.half ;
M: half-array set-nth-unsafe
[ integer>fixnum ] dip underlying>> \ half set-alien-element
; inline
USING: accessors alien.c-types kernel math.vectors.simd
math.vectors.simd.private sequences.private ;
M: int-4 set-nth-unsafe
[ int boolean>element ] 2dip
underlying>> int set-alien-element ; inline
USING: accessors alien.c-types kernel math sequences.private
specialized-arrays.instances.alien.c-types.int ;
M: int-array set-nth-unsafe
[ integer>fixnum ] dip underlying>> \ int set-alien-element
; inline
USING: accessors alien.c-types kernel math sequences.private
specialized-arrays.instances.alien.c-types.int32_t ;
M: int32_t-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ int32_t set-alien-element ; inline
USING: accessors alien.c-types io.files.acls.macos.ffi kernel
math sequences.private
specialized-arrays.instances.io.files.acls.macos.ffi.kauth_ace ;
M: kauth_ace-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ kauth_ace set-alien-element ; inline
USING: accessors alien.c-types kernel math sequences.private
specialized-arrays.instances.unix.kqueue.kevent unix.kqueue ;
M: kevent-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ kevent set-alien-element ; inline
USING: accessors alien.c-types kernel libusb math
sequences.private
specialized-arrays.instances.libusb.libusb_iso_packet_descriptor
;
M: libusb_iso_packet_descriptor-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ libusb_iso_packet_descriptor
set-alien-element ; inline
USING: accessors alien.c-types kernel math sequences.private
specialized-arrays.instances.alien.c-types.long ;
M: long-array set-nth-unsafe
[ integer>fixnum ] dip underlying>> \ long set-alien-element
; inline
USING: accessors alien.c-types kernel math.vectors.simd
math.vectors.simd.private sequences.private ;
M: longlong-2 set-nth-unsafe
[ longlong boolean>element ] 2dip
underlying>> longlong set-alien-element ; inline
USING: accessors alien.c-types kernel math sequences.private
specialized-arrays.instances.alien.c-types.longlong ;
M: longlong-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ longlong set-alien-element ; inline
USING: sequences.modified sequences.private ;
M: modified set-nth-unsafe modified-set-nth ;
USING: kernel math named-tuples sequences.private ;
M: named-tuple set-nth-unsafe
[ integer>fixnum ] dip set-array-nth ;
USING: kernel nibble-arrays nibble-arrays.private
sequences.private ;
M: nibble-array set-nth-unsafe
nibble@ [ nth-unsafe set-nibble ] 2keep set-nth-unsafe ;
USING: accessors alien.c-types kernel macho math
sequences.private specialized-arrays.instances.macho.nlist ;
M: nlist-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ nlist set-alien-element ; inline
USING: accessors alien.c-types kernel macho math
sequences.private specialized-arrays.instances.macho.nlist_64 ;
M: nlist_64-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ nlist_64 set-alien-element ; inline
USING: accessors alien.c-types kernel math papier.map
sequences.private
specialized-arrays.instances.papier.map.papier-vertex-struct ;
M: papier-vertex-struct-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ papier-vertex-struct set-alien-element ;
inline
USING: accessors alien.c-types fluids kernel math
sequences.private specialized-arrays.instances.fluids.particle_t
;
M: particle_t-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ particle_t set-alien-element ; inline
USING: benchmark.tuple-arrays sequences.private
tuple-arrays.private ;
M: point-array set-nth-unsafe
tuple-slice \ point write-tuple ; inline
USING: accessors alien.c-types benchmark.struct-arrays kernel
math sequences.private
specialized-arrays.instances.benchmark.struct-arrays.point ;
M: point-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ point set-alien-element ; inline
USING: accessors gml.types sequences.private ;
M: proc set-nth-unsafe array>> set-nth-unsafe ;
USING: accessors alien.c-types kernel math rlgl
sequences.private specialized-arrays.instances.rlgl.rlDrawCall ;
M: rlDrawCall-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ rlDrawCall set-alien-element ; inline
USING: accessors alien.c-types kernel math rlgl
sequences.private
specialized-arrays.instances.rlgl.rlVertexBuffer ;
M: rlVertexBuffer-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ rlVertexBuffer set-alien-element ; inline
USING: accessors kernel math sbufs sequences.private
strings.private ;
M: sbuf set-nth-unsafe
[ integer>fixnum ] [ integer>fixnum ] [ underlying>> ] tri*
set-string-nth ; inline
USING: accessors alien.c-types kernel macho math
sequences.private specialized-arrays.instances.macho.section ;
M: section-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ section set-alien-element ; inline
USING: accessors alien.c-types kernel macho math
sequences.private specialized-arrays.instances.macho.section_64
;
M: section_64-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ section_64 set-alien-element ; inline
USING: sequences sequences.private ;
M: sequence set-nth-unsafe set-nth ; inline
USING: accessors kernel math sequences sequences.private
sequences.shifted ;
M: shifted set-nth-unsafe
[ n>> neg + ] [ underlying>> ] bi 2dup bounds-check?
[ set-nth-unsafe ] [ 3drop ] if ;
USING: accessors alien.c-types kernel math.vectors.simd
math.vectors.simd.private sequences.private ;
M: short-8 set-nth-unsafe
[ short boolean>element ] 2dip
underlying>> short set-alien-element ; inline
USING: accessors alien.c-types kernel math sequences.private
specialized-arrays.instances.alien.c-types.short ;
M: short-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ short set-alien-element ; inline
USING: accessors alien.c-types kernel math sequences.private
specialized-arrays.instances.alien.c-types.size_t ;
M: size_t-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ size_t set-alien-element ; inline
USING: accessors alien.c-types kernel math sequences.private
specialized-arrays.instances.unix.statfs.macos.statfs64
unix.statfs.macos ;
M: statfs64-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ statfs64 set-alien-element ; inline
USING: kernel math sequences.private strings strings.private ;
M: string set-nth-unsafe
dup reset-string-hashcode
[ integer>fixnum ] [ integer>fixnum ] [ ] tri*
set-string-nth ; inline
USING: accessors kernel sequences.private xml.data ;
M: tag set-nth-unsafe
[ children>> ] call \ set-nth-unsafe execute ;
USING: accessors sequences.private tensors tensors.private ;
M: tensor set-nth-unsafe num-index vec>> set-nth-unsafe ;
USING: accessors alien.c-types kernel math ogg.theora
sequences.private
specialized-arrays.instances.ogg.theora.th-quant-ranges ;
M: th-quant-ranges-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ th-quant-ranges set-alien-element ; inline
USING: accessors alien.c-types kernel math sequences.private
specialized-arrays.instances.unix.time.timeval unix.time ;
M: timeval-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ timeval set-alien-element ; inline
USING: accessors alien.c-types kernel math sequences.private
specialized-arrays.instances.alien.c-types.u16 ;
M: u16-array set-nth-unsafe
[ integer>fixnum ] dip underlying>> \ u16 set-alien-element
; inline
USING: accessors alien.c-types kernel math sequences.private
specialized-arrays.instances.alien.c-types.u32 ;
M: u32-array set-nth-unsafe
[ integer>fixnum ] dip underlying>> \ u32 set-alien-element
; inline
USING: accessors alien.c-types kernel math sequences.private
specialized-arrays.instances.alien.c-types.u64 ;
M: u64-array set-nth-unsafe
[ integer>fixnum ] dip underlying>> \ u64 set-alien-element
; inline
USING: accessors alien.c-types kernel math sequences.private
specialized-arrays.instances.alien.c-types.u8 ;
M: u8-array set-nth-unsafe
[ integer>fixnum ] dip underlying>> \ u8 set-alien-element ;
inline
USING: accessors alien.c-types kernel math math.vectors.simd
sequences.private
specialized-arrays.instances.math.vectors.simd.uchar-16 ;
M: uchar-16-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ uchar-16 set-alien-element ; inline
USING: accessors alien.c-types kernel math.vectors.simd
math.vectors.simd.private sequences.private ;
M: uchar-16 set-nth-unsafe
[ uchar boolean>element ] 2dip
underlying>> uchar set-alien-element ; inline
USING: accessors alien.c-types kernel math sequences.private
specialized-arrays.instances.alien.c-types.uchar ;
M: uchar-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ uchar set-alien-element ; inline
USING: accessors alien.c-types kernel math math.vectors.simd
sequences.private
specialized-arrays.instances.math.vectors.simd.uint-4 ;
M: uint-4-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ uint-4 set-alien-element ; inline
USING: accessors alien.c-types kernel math.vectors.simd
math.vectors.simd.private sequences.private ;
M: uint-4 set-nth-unsafe
[ uint boolean>element ] 2dip
underlying>> uint set-alien-element ; inline
USING: accessors alien.c-types kernel math sequences.private
specialized-arrays.instances.alien.c-types.uint ;
M: uint-array set-nth-unsafe
[ integer>fixnum ] dip underlying>> \ uint set-alien-element
; inline
USING: accessors alien.c-types kernel math sequences.private
specialized-arrays.instances.alien.c-types.uint16_t ;
M: uint16_t-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ uint16_t set-alien-element ; inline
USING: accessors alien.c-types kernel math sequences.private
specialized-arrays.instances.alien.c-types.uint32_t ;
M: uint32_t-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ uint32_t set-alien-element ; inline
USING: accessors alien.c-types kernel math sequences.private
specialized-arrays.instances.alien.c-types.uint64_t ;
M: uint64_t-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ uint64_t set-alien-element ; inline
USING: accessors alien.c-types kernel math sequences.private
specialized-arrays.instances.alien.c-types.uint8_t ;
M: uint8_t-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ uint8_t set-alien-element ; inline
USING: accessors alien.c-types kernel math sequences.private
specialized-arrays.instances.alien.c-types.uintptr_t ;
M: uintptr_t-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ uintptr_t set-alien-element ; inline
USING: accessors alien.c-types kernel math sequences.private
specialized-arrays.instances.alien.c-types.ulong ;
M: ulong-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ ulong set-alien-element ; inline
USING: accessors alien.c-types kernel math.vectors.simd
math.vectors.simd.private sequences.private ;
M: ulonglong-2 set-nth-unsafe
[ ulonglong boolean>element ] 2dip
underlying>> ulonglong set-alien-element ; inline
USING: accessors alien.c-types kernel math sequences.private
specialized-arrays.instances.alien.c-types.ulonglong ;
M: ulonglong-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ ulonglong set-alien-element ; inline
USING: accessors alien.c-types kernel math.vectors.simd
math.vectors.simd.private sequences.private ;
M: ushort-8 set-nth-unsafe
[ ushort boolean>element ] 2dip
underlying>> ushort set-alien-element ; inline
USING: accessors alien.c-types kernel math sequences.private
specialized-arrays.instances.alien.c-types.ushort ;
M: ushort-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ ushort set-alien-element ; inline
USING: sequences sequences.private ;
M: virtual-sequence set-nth-unsafe virtual@ set-nth-unsafe ;
inline
USING: accessors alien.c-types kernel math sequences.private
specialized-arrays.instances.alien.c-types.void* ;
M: void*-array set-nth-unsafe
[ integer>fixnum ] dip
underlying>> \ void* set-alien-element ; inline
USING: accessors kernel sequences.private xml.data ;
M: xml-chunk set-nth-unsafe
[ seq>> ] call \ set-nth-unsafe execute ;
USING: accessors kernel sequences.private xml.data ;
M: xml set-nth-unsafe [ body>> ] call \ set-nth-unsafe execute ;