set-nth-unsafe ( elt n seq -- )
Factor documentation > Factor handbook > The language > Collections > Sequence operations > Sequence protocol
Prev:set-nth ( elt n seq -- )
Next:set-length ( n seq -- )


Vocabulary
sequences.private

Inputs and outputs
eltan object
nan integer
seqa sequence


Generic word contract
Unsafe variant of set-nth that does not perform bounds checks.

Definition
IN: sequences.private

GENERIC: set-nth-unsafe ( elt n seq -- )


Methods
USING: accessors alien.c-types elf sequences.private
specialized-arrays.instances.elf.Elf32_Phdr ;

M: Elf32_Phdr-array set-nth-unsafe
underlying>> \ Elf32_Phdr set-alien-element ; inline


USING: accessors alien.c-types elf sequences.private
specialized-arrays.instances.elf.Elf32_Shdr ;

M: Elf32_Shdr-array set-nth-unsafe
underlying>> \ Elf32_Shdr set-alien-element ; inline


USING: accessors alien.c-types elf sequences.private
specialized-arrays.instances.elf.Elf32_Sym ;

M: Elf32_Sym-array set-nth-unsafe
underlying>> \ Elf32_Sym set-alien-element ; inline


USING: accessors alien.c-types elf sequences.private
specialized-arrays.instances.elf.Elf64_Phdr ;

M: Elf64_Phdr-array set-nth-unsafe
underlying>> \ Elf64_Phdr set-alien-element ; inline


USING: accessors alien.c-types elf sequences.private
specialized-arrays.instances.elf.Elf64_Shdr ;

M: Elf64_Shdr-array set-nth-unsafe
underlying>> \ Elf64_Shdr set-alien-element ; inline


USING: accessors alien.c-types elf sequences.private
specialized-arrays.instances.elf.Elf64_Sym ;

M: Elf64_Sym-array set-nth-unsafe
underlying>> \ Elf64_Sym set-alien-element ; inline


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
sequences.private
specialized-arrays.instances.benchmark.nbody-simd.body ;

M: body-array set-nth-unsafe
underlying>> \ body set-alien-element ; inline


USING: accessors alien.c-types gpu.demos.bunny
sequences.private
specialized-arrays.instances.gpu.demos.bunny.bunny-vertex-struct
;

M: bunny-vertex-struct-array set-nth-unsafe
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.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 sequences.private
specialized-arrays.instances.alien.c-types.char ;

M: char-array set-nth-unsafe
underlying>> \ char set-alien-element ; inline


USING: sequences sequences.complex-components sequences.private
;

M: complex-components set-nth-unsafe immutable ;


USING: accessors alien.c-types alien.complex sequences.private
specialized-arrays.instances.alien.complex.complex-double ;

M: complex-double-array set-nth-unsafe
underlying>> \ complex-double set-alien-element ; inline


USING: accessors alien.c-types alien.complex sequences.private
specialized-arrays.instances.alien.complex.complex-float ;

M: complex-float-array set-nth-unsafe
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 sequences.private
specialized-arrays.instances.chipmunk.ffi.cpContact ;

M: cpContact-array set-nth-unsafe
underlying>> \ cpContact set-alien-element ; inline


USING: accessors alien.c-types chipmunk.ffi sequences.private
specialized-arrays.instances.chipmunk.ffi.cpPolyShapeAxis ;

M: cpPolyShapeAxis-array set-nth-unsafe
underlying>> \ cpPolyShapeAxis set-alien-element ; inline


USING: accessors alien.c-types chipmunk.ffi sequences.private
specialized-arrays.instances.chipmunk.ffi.cpVect ;

M: cpVect-array set-nth-unsafe
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 math.vectors.simd.cords
sequences.private
specialized-arrays.instances.math.vectors.simd.cords.double-4 ;

M: double-4-array set-nth-unsafe
underlying>> \ double-4 set-alien-element ; inline


USING: accessors alien.c-types sequences.private
specialized-arrays.instances.alien.c-types.double ;

M: double-array set-nth-unsafe
underlying>> \ double set-alien-element ; inline


USING: accessors alien.c-types sequences.private
specialized-arrays.instances.unix.linux.epoll.epoll-event
unix.linux.epoll ;

M: epoll-event-array set-nth-unsafe
underlying>> \ epoll-event set-alien-element ; inline


USING: accessors alien.c-types macho sequences.private
specialized-arrays.instances.macho.fat_arch ;

M: fat_arch-array set-nth-unsafe
underlying>> \ fat_arch set-alien-element ; inline


USING: accessors alien.c-types math.vectors.simd
sequences.private
specialized-arrays.instances.math.vectors.simd.float-4 ;

M: float-4-array set-nth-unsafe
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 sequences.private
specialized-arrays.instances.alien.c-types.float ;

M: float-array set-nth-unsafe
underlying>> \ float set-alien-element ; inline


USING: accessors alien.c-types game.loop.benchmark
sequences.private
specialized-arrays.instances.game.loop.benchmark.game-loop-benchmark
;

M: game-loop-benchmark-array set-nth-unsafe
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 math.floats.half
sequences.private
specialized-arrays.instances.math.floats.half.half ;

M: half-array set-nth-unsafe
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 sequences.private
specialized-arrays.instances.alien.c-types.int ;

M: int-array set-nth-unsafe
underlying>> \ int set-alien-element ; inline


USING: accessors alien.c-types libusb sequences.private
specialized-arrays.instances.libusb.libusb_iso_packet_descriptor
;

M: libusb_iso_packet_descriptor-array set-nth-unsafe
underlying>> \ libusb_iso_packet_descriptor
set-alien-element ; inline


USING: accessors alien.c-types sequences.private
specialized-arrays.instances.alien.c-types.long ;

M: long-array set-nth-unsafe
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 sequences.private
specialized-arrays.instances.alien.c-types.longlong ;

M: longlong-array set-nth-unsafe
underlying>> \ longlong set-alien-element ; inline


USING: sequences.modified sequences.private ;

M: modified set-nth-unsafe modified-set-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 macho sequences.private
specialized-arrays.instances.macho.nlist ;

M: nlist-array set-nth-unsafe
underlying>> \ nlist set-alien-element ; inline


USING: accessors alien.c-types macho sequences.private
specialized-arrays.instances.macho.nlist_64 ;

M: nlist_64-array set-nth-unsafe
underlying>> \ nlist_64 set-alien-element ; inline


USING: accessors alien.c-types fluids sequences.private
specialized-arrays.instances.fluids.particle_t ;

M: particle_t-array set-nth-unsafe
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
sequences.private
specialized-arrays.instances.benchmark.struct-arrays.point ;

M: point-array set-nth-unsafe
underlying>> \ point 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 macho sequences.private
specialized-arrays.instances.macho.section ;

M: section-array set-nth-unsafe
underlying>> \ section set-alien-element ; inline


USING: accessors alien.c-types macho sequences.private
specialized-arrays.instances.macho.section_64 ;

M: section_64-array set-nth-unsafe
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 sequences.private
specialized-arrays.instances.alien.c-types.short ;

M: short-array set-nth-unsafe
underlying>> \ short set-alien-element ; inline


USING: accessors alien.c-types sequences.private
specialized-arrays.instances.alien.c-types.size_t ;

M: size_t-array set-nth-unsafe
underlying>> \ size_t 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 alien.c-types ogg.theora sequences.private
specialized-arrays.instances.ogg.theora.th-quant-ranges ;

M: th-quant-ranges-array set-nth-unsafe
underlying>> \ th-quant-ranges set-alien-element ; inline


USING: accessors alien.c-types sequences.private
specialized-arrays.instances.unix.time.timeval unix.time ;

M: timeval-array set-nth-unsafe
underlying>> \ timeval set-alien-element ; inline


USING: accessors alien.c-types math.vectors.simd
sequences.private
specialized-arrays.instances.math.vectors.simd.uchar-16 ;

M: uchar-16-array set-nth-unsafe
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 sequences.private
specialized-arrays.instances.alien.c-types.uchar ;

M: uchar-array set-nth-unsafe
underlying>> \ uchar set-alien-element ; inline


USING: accessors alien.c-types sequences.private
specialized-arrays.instances.tools.disassembler.udis.ud_operand
tools.disassembler.udis ;

M: ud_operand-array set-nth-unsafe
underlying>> \ ud_operand set-alien-element ; inline


USING: accessors alien.c-types math.vectors.simd
sequences.private
specialized-arrays.instances.math.vectors.simd.uint-4 ;

M: uint-4-array set-nth-unsafe
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 sequences.private
specialized-arrays.instances.alien.c-types.uint ;

M: uint-array set-nth-unsafe
underlying>> \ uint set-alien-element ; inline


USING: accessors alien.c-types sequences.private
specialized-arrays.instances.alien.c-types.uintptr_t ;

M: uintptr_t-array set-nth-unsafe
underlying>> \ uintptr_t set-alien-element ; inline


USING: accessors alien.c-types sequences.private
specialized-arrays.instances.alien.c-types.ulong ;

M: ulong-array set-nth-unsafe
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 sequences.private
specialized-arrays.instances.alien.c-types.ulonglong ;

M: ulonglong-array set-nth-unsafe
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 sequences.private
specialized-arrays.instances.alien.c-types.ushort ;

M: ushort-array set-nth-unsafe
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 sequences.private
specialized-arrays.instances.alien.c-types.void* ;

M: void*-array set-nth-unsafe
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 ;