factor: SPECIALIZED-ARRAY/VECTOR to lowercase

locals-and-roots
Doug Coleman 2016-06-04 16:08:04 -07:00
parent 0ec9a62661
commit d976ffa34b
141 changed files with 225 additions and 217 deletions

View File

@ -1,6 +1,6 @@
USING: alien.c-types sequences kernel math specialized-arrays
fry ;
SPECIALIZED-ARRAY: int
specialized-array: int
in: benchmark.dawes
! Phil Dawes's performance problem

View File

@ -1,6 +1,6 @@
USING: alien.c-types make math sequences splitting grouping
kernel columns specialized-arrays bit-arrays ;
SPECIALIZED-ARRAY: double
specialized-array: double
in: benchmark.dispatch2
: sequences ( -- seq )

View File

@ -1,7 +1,7 @@
USING: alien.c-types sequences math mirrors splitting grouping
kernel make assocs alien.syntax columns
specialized-arrays bit-arrays ;
SPECIALIZED-ARRAY: double
specialized-array: double
in: benchmark.dispatch3
GENERIC: g ( obj -- str ) ;

View File

@ -3,7 +3,7 @@ USING: assocs benchmark.reverse-complement byte-arrays fry io
io.encodings.ascii io.files locals kernel math sequences
sequences.private specialized-arrays strings typed alien.data ;
QUALIFIED-WITH: alien.c-types c ;
SPECIALIZED-ARRAY: c:double
specialized-array: c:double
in: benchmark.fasta
CONSTANT: IM 139968 ;

View File

@ -14,7 +14,7 @@ STRUCT: body
{ velocity double-4 }
{ mass double } ;
SPECIALIZED-ARRAY: body
specialized-array: body
: <body> ( location velocity mass -- body )
[ days-per-year v*n ] [ solar-mass * ] bi* body <struct-boa> ; inline

View File

@ -4,7 +4,7 @@ USING: accessors specialized-arrays fry kernel
locals math math.constants math.functions math.vectors
prettyprint combinators.smart sequences hints arrays ;
FROM: alien.c-types => double ;
SPECIALIZED-ARRAY: double
specialized-array: double
in: benchmark.nbody
: solar-mass ( -- x ) 4 pi sq * ; inline

View File

@ -5,7 +5,7 @@ io.files io.files.temp io.encodings.binary kernel math
math.constants math.functions math.vectors math.parser make
sequences sequences.private words hints ;
FROM: alien.c-types => double ;
SPECIALIZED-ARRAY: double
specialized-array: double
in: benchmark.raytracer
! parameters

View File

@ -3,7 +3,7 @@
USING: kernel io math math.functions math.parser math.vectors
math.vectors.simd sequences specialized-arrays ;
QUALIFIED-WITH: alien.c-types c ;
SPECIALIZED-ARRAY: float-4
specialized-array: float-4
in: benchmark.simd-1
: <point> ( n -- float-4 )

View File

@ -6,7 +6,7 @@
USING: alien.c-types io kernel math math.functions math.parser
math.vectors sequences sequences.private specialized-arrays
typed locals ;
SPECIALIZED-ARRAY: double
specialized-array: double
in: benchmark.spectral-norm
:: inner-loop ( u n quot -- seq )

View File

@ -8,7 +8,7 @@ in: benchmark.struct-arrays
STRUCT: point { x float } { y float } { z float } ;
SPECIALIZED-ARRAY: point
specialized-array: point
: xyz ( point -- x y z )
[ x>> ] [ y>> ] [ z>> ] tri ; inline

View File

@ -1,7 +1,7 @@
in: grid-meshes.tests
USING: alien.c-types alien.data grid-meshes grid-meshes.private
specialized-arrays tools.test ;
SPECIALIZED-ARRAY: float
specialized-array: float
{
float-array{

View File

@ -3,7 +3,7 @@ USING: accessors alien.data.map arrays destructors fry grouping
kernel math math.ranges math.vectors.simd opengl opengl.gl sequences
sequences.product specialized-arrays ;
FROM: alien.c-types => float ;
SPECIALIZED-ARRAY: float-4
specialized-array: float-4
in: grid-meshes
TUPLE: grid-mesh dim buffer row-length ;

View File

@ -3,7 +3,7 @@
USING: accessors alien.c-types arrays assocs binary-search
combinators fry grouping kernel locals make math math.order
sequences sequences.private sorting specialized-arrays ;
SPECIALIZED-ARRAY: uint
specialized-array: uint
in: interval-sets
! Sets of positive integers

View File

@ -15,7 +15,7 @@ HELP: complex-sequence
{ $class-description "Sequence wrapper class that transforms a sequence of " { $link real } " number values into a sequence of " { $link complex } " values, treating the underlying sequence as pairs of alternating real and imaginary values." }
{ $examples { $example "USING: prettyprint specialized-arrays
sequences.complex sequences alien.c-types arrays ;
SPECIALIZED-ARRAY: double
specialized-array: double
double-array{ 1.0 -1.0 -2.0 2.0 3.0 0.0 } <complex-sequence> >array ."
"{ C{ 1.0 -1.0 } C{ -2.0 2.0 } C{ 3.0 0.0 } }" } } ;
@ -24,7 +24,7 @@ HELP: <complex-sequence>
{ $description "Wraps " { $snippet "sequence" } " in a " { $link complex-sequence } "." }
{ $examples { $example "USING: prettyprint specialized-arrays
sequences.complex sequences alien.c-types arrays ;
SPECIALIZED-ARRAY: double
specialized-array: double
double-array{ 1.0 -1.0 -2.0 2.0 3.0 0.0 } <complex-sequence> second ."
"C{ -2.0 2.0 }" } } ;

View File

@ -1,7 +1,7 @@
USING: specialized-arrays sequences.complex
kernel sequences tools.test arrays accessors ;
QUALIFIED-WITH: alien.c-types c ;
SPECIALIZED-ARRAY: c:float
specialized-array: c:float
in: sequences.complex.tests
: test-array ( -- x )

View File

@ -1,8 +1,8 @@
USING: help.markup help.syntax byte-arrays alien math sequences ;
in: specialized-arrays
HELP: SPECIALIZED-ARRAY:
{ $syntax "SPECIALIZED-ARRAY: type" }
HELP: specialized-array:
{ $syntax "specialized-array: type" }
{ $values { "type" "a C type" } }
{ $description "Brings a specialized array for holding values of " { $snippet "type" } " into the vocabulary search path. The generated words are documented in " { $link "specialized-array-words" } "." } ;
@ -11,7 +11,7 @@ HELP: SPECIALIZED-ARRAYS:
{ $values { "type" "a C type" } }
{ $description "Brings a set of specialized arrays for holding values of each " { $snippet "type" } " into the vocabulary search path. The generated words are documented in " { $link "specialized-array-words" } "." } ;
{ postpone: SPECIALIZED-ARRAY: postpone: SPECIALIZED-ARRAYS: } related-words
{ postpone: specialized-array: postpone: SPECIALIZED-ARRAYS: } related-words
HELP: direct-slice
{ $values { "from" integer } { "to" integer } { "seq" "a specialized array" } { "seq'" "a new specialized array" } }
@ -36,7 +36,7 @@ HELP: direct-tail*
{ direct-slice direct-head direct-tail direct-head* direct-tail* } related-words
ARTICLE: "specialized-array-words" "Specialized array words"
"The " { $link postpone: SPECIALIZED-ARRAY: } " and " { $link postpone: SPECIALIZED-ARRAYS: } " parsing words generate specialized array types if they haven't been generated already and add the following words to the vocabulary search path, where " { $snippet "T" } " is the C type in question:"
"The " { $link postpone: specialized-array: } " and " { $link postpone: SPECIALIZED-ARRAYS: } " parsing words generate specialized array types if they haven't been generated already and add the following words to the vocabulary search path, where " { $snippet "T" } " is the C type in question:"
{ $table
{ { $snippet "T-array" } { "The class of arrays with elements of type " { $snippet "T" } } }
{ { $snippet "<T-array>" } { "Constructor for arrays with elements of type " { $snippet "T" } "; stack effect " { $snippet "( len -- array )" } } }
@ -44,7 +44,7 @@ ARTICLE: "specialized-array-words" "Specialized array words"
{ { $snippet "<direct-T-array>" } { "Constructor for arrays with elements of type " { $snippet "T" } " backed by raw memory; stack effect " { $snippet "( alien len -- array )" } } }
{ { $snippet "T-array{" } { "Literal syntax, consists of a series of values terminated by " { $snippet "}" } } }
}
"Behind the scenes, these words are placed in a vocabulary named " { $snippet "specialized-arrays.instances.T" } ", however this vocabulary should not be placed in a " { $link postpone: USING: } " form directly. Instead, always use " { $link postpone: SPECIALIZED-ARRAY: } " or " { $link postpone: SPECIALIZED-ARRAYS: } ". This ensures that the vocabulary can get generated the first time it is needed."
"Behind the scenes, these words are placed in a vocabulary named " { $snippet "specialized-arrays.instances.T" } ", however this vocabulary should not be placed in a " { $link postpone: USING: } " form directly. Instead, always use " { $link postpone: specialized-array: } " or " { $link postpone: SPECIALIZED-ARRAYS: } ". This ensures that the vocabulary can get generated the first time it is needed."
$nl
"Additionally, special versions of the standard " { $link <slice> } ", " { $link head } ", and " { $link tail } " sequence operations are provided for specialized arrays to create a new specialized array object sharing storage with a subsequence of an existing array:"
{ $subsections
@ -63,7 +63,7 @@ $nl
"Here is an example; as is common with C functions, the array length is passed in separately, since C does not offer a runtime facility to determine the array length of a base pointer:"
{ $code
"USING: alien.syntax specialized-arrays ;"
"SPECIALIZED-ARRAY: int"
"specialized-array: int"
"FUNCTION: void process_data ( int* data, int len ) ;"
"int-array{ 10 20 30 } dup length process_data"
}
@ -72,7 +72,7 @@ $nl
"In the following example, it is presumed that the C library holds on to a pointer to the array's data after the " { $snippet "init_with_data()" } " call returns; this is one situation where unmanaged memory has to be used instead. Note the use of destructors to ensure the memory is deallocated after the block ends:"
{ $code
"USING: alien.syntax specialized-arrays ;"
"SPECIALIZED-ARRAY: float"
"specialized-array: float"
"FUNCTION: void init_with_data ( float* data, int len ) ;"
"FUNCTION: float compute_result ( ) ;"
"["
@ -102,7 +102,7 @@ ARTICLE: "specialized-array-math" "Vector arithmetic with specialized arrays"
ARTICLE: "specialized-array-examples" "Specialized array examples"
"Let's import specialized float arrays:"
{ $code "USING: specialized-arrays math.constants math.functions ;" "SPECIALIZED-ARRAY: float" }
{ $code "USING: specialized-arrays math.constants math.functions ;" "specialized-array: float" }
"Creating a float array with 3 elements:"
{ $code "1.0 [ sin ] [ cos ] [ tan ] tri float-array{ } 3sequence ." }
"Create a float array and sum the elements:"
@ -116,7 +116,7 @@ ARTICLE: "specialized-arrays" "Specialized arrays"
$nl
"A specialized array type needs to be generated for each element type. This is done with parsing words:"
{ $subsections
postpone: SPECIALIZED-ARRAY:
postpone: specialized-array:
postpone: SPECIALIZED-ARRAYS:
}
"This parsing word adds new words to the search path, documented in the next section."

View File

@ -10,7 +10,7 @@ heap-size ;
FROM: alien.data => little-endian? ;
in: specialized-arrays.tests
SPECIALIZED-ARRAY: int
specialized-array: int
SPECIALIZED-ARRAYS: bool uchar ushort char uint float ulonglong ;
{ t } [ { 1 2 3 } int >c-array int-array? ] unit-test
@ -53,7 +53,7 @@ STRUCT: test-struct
{ x int }
{ y int } ;
SPECIALIZED-ARRAY: test-struct
specialized-array: test-struct
{ 1 } [
1 test-struct-array{ } new-sequence length
@ -111,7 +111,7 @@ SPECIALIZED-ARRAY: test-struct
! Regression
STRUCT: fixed-string { text char[64] } ;
SPECIALIZED-ARRAY: fixed-string
specialized-array: fixed-string
{ { ALIEN: 100 ALIEN: 140 ALIEN: 180 ALIEN: 1c0 } } [
ALIEN: 100 4 <direct-fixed-string-array> [ (underlying)>> ] { } map-as
@ -140,7 +140,7 @@ symbol: __does_not_exist__
in: specialized-arrays.tests
USING: specialized-arrays ;
SPECIALIZED-ARRAY: __does_not_exist__ " eval( -- )
specialized-array: __does_not_exist__ " eval( -- )
] must-fail
{ } [
@ -150,7 +150,7 @@ USING: alien.c-types classes.struct specialized-arrays ;
STRUCT: __does_not_exist__ { x int } ;
SPECIALIZED-ARRAY: __does_not_exist__
specialized-array: __does_not_exist__
" eval( -- )
] unit-test
@ -169,7 +169,7 @@ SPECIALIZED-ARRAY: __does_not_exist__
STRUCT: struct-resize-test { x int } ;
SPECIALIZED-ARRAY: struct-resize-test
specialized-array: struct-resize-test
{ 40 } [ 10 <struct-resize-test-array> byte-length ] unit-test

View File

@ -174,6 +174,9 @@ SYNTAX: SPECIALIZED-ARRAYS:
SYNTAX: SPECIALIZED-ARRAY:
scan-c-type define-array-vocab use-vocab ;
SYNTAX: specialized-array:
scan-c-type define-array-vocab use-vocab ;
{ "specialized-arrays" "prettyprint" } "specialized-arrays.prettyprint" require-when
{ "specialized-arrays" "mirrors" } "specialized-arrays.mirrors" require-when

View File

@ -1,8 +1,8 @@
USING: help.markup help.syntax byte-vectors alien byte-arrays classes.struct ;
in: specialized-vectors
HELP: SPECIALIZED-VECTOR:
{ $syntax "SPECIALIZED-VECTOR: type" }
HELP: specialized-vector:
{ $syntax "specialized-vector: type" }
{ $values { "type" "a C type" } }
{ $description "Brings a specialized vector for holding values of " { $snippet "type" } " into the vocabulary search path. The generated words are documented in " { $link "specialized-vector-words" } "." } ;
@ -11,17 +11,17 @@ HELP: SPECIALIZED-VECTORS:
{ $values { "type" "a C type" } }
{ $description "Brings a set of specialized vectors for holding values of each " { $snippet "type" } " into the vocabulary search path. The generated words are documented in " { $link "specialized-vector-words" } "." } ;
{ postpone: SPECIALIZED-VECTOR: postpone: SPECIALIZED-VECTORS: } related-words
{ postpone: specialized-vector: postpone: SPECIALIZED-VECTORS: } related-words
ARTICLE: "specialized-vector-words" "Specialized vector words"
"The " { $link postpone: SPECIALIZED-VECTOR: } " parsing word generates the specialized vector type if it hasn't been generated already, and adds the following words to the vocabulary search path, where " { $snippet "T" } " is the C type in question:"
"The " { $link postpone: specialized-vector: } " parsing word generates the specialized vector type if it hasn't been generated already, and adds the following words to the vocabulary search path, where " { $snippet "T" } " is the C type in question:"
{ $table
{ { $snippet "T-vector" } { "The class of vectors with elements of type " { $snippet "T" } } }
{ { $snippet "<T-vector>" } { "Constructor for vectors with elements of type " { $snippet "T" } "; stack effect " { $snippet "( len -- vector )" } } }
{ { $snippet ">T-vector" } { "Converts a sequence into a specialized vector of type " { $snippet "T" } "; stack effect " { $snippet "( seq -- vector )" } } }
{ { $snippet "T-vector{" } { "Literal syntax, consists of a series of values terminated by " { $snippet "}" } } }
}
"Behind the scenes, these words are placed in a vocabulary named " { $snippet "specialized-vectors.instances.T" } ", however this vocabulary should not be placed in a " { $link postpone: USING: } " form directly. Instead, always use " { $link postpone: SPECIALIZED-VECTOR: } ". This ensures that the vocabulary can get generated the first time it is needed." ;
"Behind the scenes, these words are placed in a vocabulary named " { $snippet "specialized-vectors.instances.T" } ", however this vocabulary should not be placed in a " { $link postpone: USING: } " form directly. Instead, always use " { $link postpone: specialized-vector: } ". This ensures that the vocabulary can get generated the first time it is needed." ;
HELP: push-new
{ $values { "vector" "a specialized vector of structs" } { "new" "a new value of the specialized vector's type" } }
@ -45,7 +45,7 @@ ARTICLE: "specialized-vectors" "Specialized vectors"
$nl
"A specialized vector type needs to be generated for each element type. This is done with parsing words:"
{ $subsections
postpone: SPECIALIZED-VECTOR:
postpone: specialized-vector:
postpone: SPECIALIZED-VECTORS:
}
{ $subsections

View File

@ -1,7 +1,7 @@
in: specialized-vectors.tests
USING: specialized-arrays specialized-vectors
tools.test kernel sequences alien.c-types ;
SPECIALIZED-ARRAY: float
specialized-array: float
SPECIALIZED-VECTORS: float double ;
{ 3 } [ double-vector{ 1 2 } 3 suffix! length ] unit-test

View File

@ -88,4 +88,9 @@ SYNTAX: SPECIALIZED-VECTOR:
[ define-array-vocab use-vocab ]
[ define-vector-vocab use-vocab ] bi ;
SYNTAX: specialized-vector:
scan-c-type
[ define-array-vocab use-vocab ]
[ define-vector-vocab use-vocab ] bi ;
{ "specialized-vectors" "mirrors" } "specialized-vectors.mirrors" require-when

View File

@ -1,7 +1,7 @@
USING: alien.c-types assocs kernel make math namespaces
sequences specialized-arrays tools.test ;
in: assocs.tests
SPECIALIZED-ARRAY: double
specialized-array: double
in: assocs.tests
{ t } [ H{ } dup assoc-subset? ] unit-test

View File

@ -5,7 +5,7 @@ generic.standard io.streams.string kernel make math
math.constants math.functions namespaces parser quotations
sequences specialized-vectors strings tools.test words ;
QUALIFIED-WITH: alien.c-types c ;
SPECIALIZED-VECTOR: c:double
specialized-vector: c:double
in: generic.standard.tests
GENERIC: class-of ( x -- y ) ;

View File

@ -8,7 +8,7 @@ specialized-arrays system threads tools.test vocabs ;
FROM: specialized-arrays.private => specialized-array-vocab ;
in: io.files.tests
SPECIALIZED-ARRAY: int
specialized-array: int
{ } [
[ ascii <file-appender> dispose ] with-test-file
@ -99,7 +99,7 @@ SPECIALIZED-ARRAY: int
] with-test-file
STRUCT: pt { x uint } { y uint } ;
SPECIALIZED-ARRAY: pt
specialized-array: pt
CONSTANT: pt-array-1
pt-array{ S{ pt f 1 1 } S{ pt f 2 2 } S{ pt f 3 3 } }

View File

@ -2,7 +2,7 @@ USING: alien.c-types alien.data arrays io io.encodings.ascii
io.encodings.binary io.encodings.utf8 io.streams.byte-array
kernel math specialized-arrays strings tools.test ;
in: io.streams.byte-array.tests
SPECIALIZED-ARRAY: int
specialized-array: int
{ B{ } } [ B{ } binary [ contents ] with-byte-reader ] unit-test

View File

@ -1,7 +1,7 @@
USING: alien.c-types alien.data io io.encodings.ascii io.files
io.pathnames io.streams.c kernel math specialized-arrays
strings tools.test ;
SPECIALIZED-ARRAY: int
specialized-array: int
[
! Writing strings to ascii streams

View File

@ -1,6 +1,6 @@
USING: alien.c-types continuations destructors kernel
opengl opengl.gl bunny.model specialized-arrays accessors ;
SPECIALIZED-ARRAY: float
specialized-array: float
in: bunny.fixed-pipeline
TUPLE: bunny-fixed-pipeline ;

View File

@ -4,8 +4,8 @@ locals math math.matrices math.parser math.vectors opengl
opengl.capabilities opengl.gl opengl.demo-support sequences
splitting vectors words specialized-arrays alien.data ;
QUALIFIED-WITH: alien.c-types c ;
SPECIALIZED-ARRAY: c:float
SPECIALIZED-ARRAY: c:uint
specialized-array: c:float
specialized-array: c:uint
in: bunny.model
: numbers ( str -- seq )

View File

@ -7,7 +7,7 @@ USING: cairo cairo.ffi locals math.constants math
io.backend kernel alien.c-types libc namespaces
cairo-gadgets ui.gadgets accessors specialized-arrays
classes.struct ;
SPECIALIZED-ARRAY: double
specialized-array: double
in: cairo-samples
TUPLE: arc-gadget < cairo-gadget ;

View File

@ -3,7 +3,7 @@
USING: accessors alien.data assocs classes.struct cocoa
cocoa.runtime cocoa.types destructors fry hashtables kernel libc
locals sequences specialized-arrays vectors ;
SPECIALIZED-ARRAY: id
specialized-array: id
in: cocoa.enumeration
CONSTANT: NS-EACH-BUFFER-SIZE 16 ;

View File

@ -9,7 +9,7 @@ stack-checker strings words ;
QUALIFIED-WITH: alien.c-types c ;
in: cocoa.messages
SPECIALIZED-ARRAY: void*
specialized-array: void*
: make-sender ( signature function -- quot )
[ over first , f , , second , \ alien-invoke , ] [ ] make ;

View File

@ -4,7 +4,7 @@ USING: accessors alien.c-types alien.data alien.syntax assocs
core-foundation kernel sequences specialized-arrays ;
in: core-foundation.dictionaries
SPECIALIZED-ARRAY: void*
specialized-array: void*
TYPEDEF: void* CFDictionaryRef
TYPEDEF: void* CFMutableDictionaryRef

View File

@ -8,9 +8,9 @@ io.encodings.utf8 kernel locals namespaces sequences
specialized-arrays unix.types ;
in: core-foundation.fsevents
SPECIALIZED-ARRAY: void*
SPECIALIZED-ARRAY: uint
SPECIALIZED-ARRAY: ulonglong
specialized-array: void*
specialized-array: uint
specialized-array: ulonglong
CONSTANT: kFSEventStreamCreateFlagNone 0x00000000 ;
CONSTANT: kFSEventStreamCreateFlagUseCFTypes 0x00000001 ;

View File

@ -4,7 +4,7 @@ USING: alien.c-types alien.data alien.syntax classes.struct
continuations core-foundation core-foundation.strings
core-foundation.urls destructors kernel sequences
specialized-arrays strings unix.ffi ;
SPECIALIZED-ARRAY: char
specialized-array: char
in: core-foundation.launch-services
FUNCTION: OSStatus LSFindApplicationForInfo (

View File

@ -4,8 +4,8 @@
USING: alien.c-types destructors fftw.ffi fry kernel locals math
math.functions math.vectors sequences sequences.private
specialized-arrays ;
SPECIALIZED-ARRAY: double
SPECIALIZED-ARRAY: fftw_complex
specialized-array: double
specialized-array: fftw_complex
in: fftw

View File

@ -210,7 +210,7 @@ STRUCT: libusb_iso_packet_descriptor
{ length uint }
{ actual_length uint }
{ status libusb_transfer_status } ;
SPECIALIZED-ARRAY: libusb_iso_packet_descriptor
specialized-array: libusb_iso_packet_descriptor
C-TYPE: libusb_transfer

View File

@ -5,7 +5,7 @@ alien.syntax namespaces alien.c-types sequences vocabs
shuffle openal openal.alut.backend alien.libraries generalizations
specialized-arrays alien.destructors ;
FROM: alien.c-types => float short ;
SPECIALIZED-ARRAY: uint
specialized-array: uint
in: openal.alut
<< "alut" {

View File

@ -6,7 +6,7 @@ shuffle alien.libraries generalizations
specialized-arrays alien.destructors alien.data ;
FROM: alien.c-types => char double float int short uchar uint
ushort void ;
SPECIALIZED-ARRAY: uint
specialized-array: uint
in: openal
<< "openal" {

View File

@ -4,7 +4,7 @@ USING: multiline locals io.encodings.ascii io.encodings.string sequences
math specialized-arrays alien.c-types math.order alien opencl tools.test
accessors arrays destructors kernel namespaces alien.data ;
FROM: alien.c-types => float ;
SPECIALIZED-ARRAY: float
specialized-array: float
in: opencl.tests
STRING: kernel-source

View File

@ -7,8 +7,8 @@ combinators.smart continuations fry init io kernel locals macros
math math.parser namespaces opengl.gl sequences
sequences.generalizations specialized-arrays system words ;
FROM: alien.c-types => float ;
SPECIALIZED-ARRAY: float
SPECIALIZED-ARRAY: uint
specialized-array: float
specialized-array: uint
in: opengl
symbol: gl-scale-factor

View File

@ -4,7 +4,7 @@ USING: kernel opengl.gl alien.c-types continuations namespaces
assocs alien alien.data alien.strings libc opengl math sequences
combinators macros arrays io.encodings.ascii fry
specialized-arrays destructors accessors ;
SPECIALIZED-ARRAY: uint
specialized-array: uint
in: opengl.shaders
: with-gl-shader-source-ptr ( string quot -- )

View File

@ -6,7 +6,7 @@ combinators images images.tessellation grouping sequences math
math.statistics math.vectors generalizations fry arrays
namespaces system locals literals specialized-arrays ;
FROM: alien.c-types => int float ;
SPECIALIZED-ARRAY: float
specialized-array: float
in: opengl.textures
symbol: non-power-of-2-textures?

View File

@ -7,7 +7,7 @@ QUALIFIED: math
ERROR: python-error type message traceback ;
SPECIALIZED-ARRAY: void*
specialized-array: void*
! Borrowed from unix.utilities
: strings>alien ( strings encoding -- array )

View File

@ -5,7 +5,7 @@ USING: alien alien.c-types alien.data alien.strings alien.syntax
arrays assocs byte-arrays combinators core-foundation io.binary
io.encodings.utf8 libc kernel math namespaces sequences
specialized-arrays system system-info unix ;
SPECIALIZED-ARRAY: int
specialized-array: int
in: system-info.macosx

View File

@ -5,7 +5,7 @@ arrays byte-arrays classes.struct combinators kernel math
namespaces specialized-arrays system
vocabs.loader windows windows.advapi32
windows.errors windows.kernel32 words system-info ;
SPECIALIZED-ARRAY: ushort
specialized-array: ushort
in: system-info.windows
: system-info ( -- SYSTEM_INFO )

View File

@ -5,7 +5,7 @@ combinators.short-circuit fry kernel layouts sequences accessors
specialized-arrays ;
in: unix.utilities
SPECIALIZED-ARRAY: void*
specialized-array: void*
: more? ( alien -- ? )
{ [ ] [ void* deref ] } 1&& ;

View File

@ -4,7 +4,7 @@ continuations kernel namespaces windows.ole32 libc vocabs
assocs accessors arrays sequences quotations combinators math
words compiler.units destructors fry math.parser generalizations
sets specialized-arrays windows.kernel32 classes.struct ;
SPECIALIZED-ARRAY: void*
specialized-array: void*
in: windows.com.wrapper
TUPLE: com-wrapper < disposable callbacks vtbls ;

View File

@ -4,7 +4,7 @@ alien.syntax kernel system namespaces combinators sequences fry
math accessors macros words quotations libc continuations
generalizations splitting locals assocs init specialized-arrays
classes.struct strings arrays literals sequences.generalizations ;
SPECIALIZED-ARRAY: DIOBJECTDATAFORMAT
specialized-array: DIOBJECTDATAFORMAT
in: windows.directx.dinput.constants
! Some global variables aren't provided by the DirectInput DLL (they're in the

View File

@ -2,7 +2,7 @@ USING: alien.data kernel locals math math.bitwise
windows.kernel32 sequences byte-arrays unicode
io.encodings.string alien.strings arrays literals
windows.types specialized-arrays math.parser ;
SPECIALIZED-ARRAY: TCHAR
specialized-array: TCHAR
in: windows.errors
CONSTANT: APPLICATION_ERROR_MASK 0x20000000 ;

View File

@ -1,7 +1,7 @@
USING: kernel tools.test windows.ole32 alien.c-types
classes.struct specialized-arrays windows.kernel32
windows.com.syntax ;
SPECIALIZED-ARRAY: uchar
specialized-array: uchar
in: windows.ole32.tests
[ t ] [

View File

@ -3,7 +3,7 @@ math kernel sequences windows.errors windows.types io accessors
math.order namespaces make math.parser windows.kernel32
combinators locals specialized-arrays literals splitting
grouping classes.struct combinators.smart ;
SPECIALIZED-ARRAY: uchar
specialized-array: uchar
in: windows.ole32
LIBRARY: ole32

View File

@ -5,7 +5,7 @@ windows.com.wrapper windows.kernel32 windows.ole32
windows.types ;
in: windows.streams
SPECIALIZED-ARRAY: uchar
specialized-array: uchar
<PRIVATE

View File

@ -3,7 +3,7 @@
USING: accessors alien.c-types alien.data alien.strings
classes.struct io.encodings.utf8 kernel namespaces sequences
specialized-arrays x11 x11.constants x11.xlib ;
SPECIALIZED-ARRAY: int
specialized-array: int
in: x11.clipboard
! This code was based on by McCLIM's Backends/CLX/port.lisp

View File

@ -5,7 +5,7 @@
USING: alien alien.c-types alien.syntax x11 x11.xlib x11.syntax
namespaces make kernel sequences parser words
specialized-arrays accessors ;
SPECIALIZED-ARRAY: int
specialized-array: int
in: x11.glx
LIBRARY: glx

View File

@ -7,8 +7,8 @@ combinators libc calendar.format byte-arrays destructors
prettyprint accessors strings serialize io.encodings.binary
io.encodings.utf8 alien.strings io.streams.byte-array summary
present urls specialized-arrays db.private ;
SPECIALIZED-ARRAY: uint
SPECIALIZED-ARRAY: void*
specialized-array: uint
specialized-array: void*
in: db.postgresql.lib
: postgresql-result-error-message ( res -- str/f )

View File

@ -5,7 +5,7 @@ gpu.framebuffers gpu.util.wasd game.debug kernel literals locals
make math math.constants math.matrices math.parser sequences
alien.c-types specialized-arrays ui.gadgets.worlds ui.pixel-formats ;
FROM: alien.c-types => float ;
SPECIALIZED-ARRAY: float
specialized-array: float
in: game.debug.tests
:: clear-screen ( color -- )

View File

@ -7,7 +7,7 @@ specialized-arrays ui.backend.windows vectors windows.com
windows.directx.dinput windows.directx.dinput.constants
windows.kernel32 windows.messages windows.ole32 windows.errors
windows.user32 classes.struct ;
SPECIALIZED-ARRAY: DIDEVICEOBJECTDATA
specialized-array: DIDEVICEOBJECTDATA
in: game.input.dinput
CONSTANT: MOUSE-BUFFER-SIZE 16 ;

View File

@ -9,7 +9,7 @@ STRUCT: game-loop-benchmark
{ tick# ulonglong }
{ frame# ulonglong } ;
SPECIALIZED-VECTOR: game-loop-benchmark
specialized-vector: game-loop-benchmark
: <game-loop-benchmark> ( benchmark-data-pair tick frame -- obj )
\ game-loop-benchmark <struct>

View File

@ -9,8 +9,8 @@ method-chains namespaces sequences splitting threads ui ui.gadgets
ui.gadgets.worlds ui.pixel-formats specialized-arrays
specialized-vectors literals ;
FROM: alien.c-types => float ;
SPECIALIZED-ARRAY: float
SPECIALIZED-VECTOR: uint
specialized-array: float
specialized-vector: uint
in: gpu.demos.bunny
VERTEX-FORMAT: bunny-vertex
@ -61,7 +61,7 @@ TUPLE: loading-state
TUPLE: bunny-world < wasd-world
bunny sobel loading ;
SPECIALIZED-VECTOR: bunny-vertex-struct
specialized-vector: bunny-vertex-struct
UNIFORM-TUPLE: bunny-uniforms < mvp-uniforms
{ "light-position" vec3-uniform f }

View File

@ -4,8 +4,8 @@ combinators destructors gpu gpu.buffers gpu.private gpu.textures
gpu.textures.private images kernel locals math math.rectangles
opengl opengl.framebuffers opengl.gl opengl.textures sequences
specialized-arrays typed ui.gadgets.worlds variants ;
SPECIALIZED-ARRAY: int
SPECIALIZED-ARRAY: uint
specialized-array: int
specialized-array: uint
in: gpu.framebuffers
singleton: system-framebuffer

View File

@ -5,11 +5,11 @@ help.syntax images kernel math sequences
specialized-arrays strings ;
QUALIFIED-WITH: alien.c-types c ;
QUALIFIED-WITH: math m ;
SPECIALIZED-ARRAY: c:float
SPECIALIZED-ARRAY: int
SPECIALIZED-ARRAY: uint
SPECIALIZED-ARRAY: ulong
SPECIALIZED-ARRAY: void*
specialized-array: c:float
specialized-array: int
specialized-array: uint
specialized-array: ulong
specialized-array: void*
in: gpu.render
HELP: <index-elements>

View File

@ -10,8 +10,8 @@ specialized-arrays splitting strings tr ui.gadgets.worlds
variants vectors vocabs vocabs.loader vocabs.parser words
words.constant math.floats.half typed ;
QUALIFIED-WITH: alien.c-types c ;
SPECIALIZED-ARRAY: int
SPECIALIZED-ARRAY: void*
specialized-array: int
specialized-array: void*
in: gpu.shaders
VARIANT: shader-kind

View File

@ -4,8 +4,8 @@ combinators gpu kernel literals math math.rectangles opengl
opengl.gl sequences typed variants specialized-arrays ;
QUALIFIED-WITH: alien.c-types c ;
FROM: math => float ;
SPECIALIZED-ARRAY: c:int
SPECIALIZED-ARRAY: c:float
specialized-array: c:int
specialized-array: c:float
in: gpu.state
TUPLE: viewport-state

View File

@ -4,7 +4,7 @@ destructors fry gpu gpu.buffers images kernel locals math
opengl opengl.gl opengl.textures sequences
specialized-arrays typed ui.gadgets.worlds variants ;
FROM: alien.c-types => float ;
SPECIALIZED-ARRAY: float
specialized-array: float
in: gpu.textures
TUPLE: texture < gpu-object

View File

@ -3,7 +3,7 @@ USING: arrays destructors gpu.buffers gpu.framebuffers gpu.render
gpu.shaders gpu.state gpu.textures images kernel locals math
math.rectangles opengl.gl sequences specialized-arrays ;
FROM: alien.c-types => float ;
SPECIALIZED-ARRAY: float
specialized-array: float
in: gpu.util
CONSTANT: environment-cube-map-mv-matrices

View File

@ -6,7 +6,7 @@ locals math math.constants math.functions math.matrices
math.order math.vectors opengl.gl sequences
ui ui.gadgets.worlds specialized-arrays audio.engine ;
FROM: alien.c-types => float ;
SPECIALIZED-ARRAY: float
specialized-array: float
in: gpu.util.wasd
UNIFORM-TUPLE: mvp-uniforms

View File

@ -14,7 +14,7 @@ accessors math.rectangles math.order calendar ascii sets io.crlf
io.encodings.utf16n windows.errors literals ui.pixel-formats
ui.pixel-formats.private memoize classes colors
specialized-arrays classes.struct ;
SPECIALIZED-ARRAY: POINT
specialized-array: POINT
QUALIFIED-WITH: alien.c-types c ;
in: ui.backend.windows

View File

@ -1,6 +1,6 @@
USING: tools.test ui.pens.gradient ui.pens.gradient.private
colors.constants specialized-arrays alien.c-types ;
SPECIALIZED-ARRAY: float
specialized-array: float
in: ui.pens.gradient.tests
{

View File

@ -4,7 +4,7 @@ USING: accessors alien.data arrays colors combinators kernel
locals math math.vectors opengl opengl.gl sequences
specialized-arrays ui.pens ui.pens.caching ;
FROM: alien.c-types => float ;
SPECIALIZED-ARRAY: float
specialized-array: float
in: ui.pens.gradient
! Gradient pen

View File

@ -3,7 +3,7 @@
USING: accessors alien.c-types alien.data colors help.markup
help.syntax kernel opengl opengl.gl sequences math.vectors
ui.gadgets ui.pens specialized-arrays ;
SPECIALIZED-ARRAY: float
specialized-array: float
in: ui.pens.polygon
! Polygon pen

View File

@ -1,7 +1,7 @@
USING: alien.c-types alien.data accessors assocs classes
destructors functors kernel lexer math parser sequences
specialized-arrays ui.backend words ;
SPECIALIZED-ARRAY: int
specialized-array: int
in: ui.pixel-formats
SYMBOLS:

View File

@ -8,14 +8,14 @@ math.vectors namespaces opengl.gl sequences specialized-arrays
ui.gadgets.worlds ui.gestures ui.pixel-formats gpu.effects.step
images.pgm images.ppm alien.data ;
FROM: alien.c-types => float ;
SPECIALIZED-ARRAY: float
specialized-array: float
in: fluids
STRUCT: particle_t
{ p float[2] }
{ v float[2] }
{ m float } ;
SPECIALIZED-ARRAY: particle_t
specialized-array: particle_t
CONSTANT: gravity { 0.0 -0.1 } ;

View File

@ -5,7 +5,7 @@ jamshred.player jamshred.tunnel kernel math math.constants
math.functions math.vectors opengl opengl.gl opengl.glu
opengl.demo-support sequences specialized-arrays locals ;
FROM: alien.c-types => float ;
SPECIALIZED-ARRAY: float
specialized-array: float
in: jamshred.gl
CONSTANT: min-vertices 6 ;

View File

@ -5,7 +5,7 @@ jamshred.oint jamshred.sound jamshred.tunnel kernel locals math
math.constants math.order math.ranges math.vectors math.matrices
sequences shuffle specialized-arrays strings system ;
QUALIFIED-WITH: alien.c-types c ;
SPECIALIZED-ARRAY: c:float
specialized-array: c:float
in: jamshred.player
TUPLE: player < oint

View File

@ -3,7 +3,7 @@
USING: accessors arrays jamshred.oint jamshred.tunnel kernel
math.vectors sequences specialized-arrays tools.test
alien.c-types ;
SPECIALIZED-ARRAY: float
specialized-array: float
in: jamshred.tunnel.tests
: test-segment-oint ( -- oint )

View File

@ -6,7 +6,7 @@ math.order math.quadratic math.ranges math.vectors random
sequences specialized-arrays vectors ;
FROM: jamshred.oint => distance ;
FROM: alien.c-types => float ;
SPECIALIZED-ARRAY: float
specialized-array: float
in: jamshred.tunnel
CONSTANT: n-segments 5000 ;

View File

@ -8,7 +8,7 @@ locals math math.order openal openal.alut opengl.gl sequences
specialized-arrays ui ui.gadgets ui.gestures ui.render ;
QUALIFIED: threads
QUALIFIED: system
SPECIALIZED-ARRAY: uchar
specialized-array: uchar
in: space-invaders
TUPLE: space-invaders < cpu

View File

@ -10,7 +10,7 @@ ui.gadgets.worlds ui.pixel-formats game.worlds
math.matrices.simd noise ui.gestures combinators.short-circuit
destructors grid-meshes math.vectors.simd ;
QUALIFIED-WITH: alien.c-types c ;
SPECIALIZED-ARRAY: c:float
specialized-array: c:float
in: terrain
CONSTANT: FOV $[ 2.0 sqrt 1 + ] ;

View File

@ -27,7 +27,7 @@ os windows? cpu x86.64? and [
STRUCT: foo { a c:int } { b c:void* } { c c:bool } ;
SPECIALIZED-ARRAY: foo
specialized-array: foo
{ t } [ 0 binary-zero? ] unit-test
{ f } [ 1 binary-zero? ] unit-test

View File

@ -109,7 +109,7 @@ TYPEDEF: int alien-parser-test-int ! reasonably unique name...
{ "OK!" } [
[
"use: specialized-arrays SPECIALIZED-ARRAY: alien-parser-test-int" eval( -- )
"use: specialized-arrays specialized-array: alien-parser-test-int" eval( -- )
! after restart, we end up here
"OK!"
] [ :1 ] recover

View File

@ -135,7 +135,7 @@ ARTICLE: "classes.struct.examples" "Struct class examples"
"Creating a new instance with slots initialized from the stack:"
{ $code
"USING: libc specialized-arrays alien.data ;"
"SPECIALIZED-ARRAY: char"
"specialized-array: char"
""
"42"
"\"Hello, chicken.\" char >c-array"

View File

@ -11,9 +11,9 @@ sequences specialized-arrays specialized-arrays.private
system tools.test vocabs ;
FROM: math => float ;
QUALIFIED-WITH: alien.c-types c ;
SPECIALIZED-ARRAY: char
SPECIALIZED-ARRAY: int
SPECIALIZED-ARRAY: ushort
specialized-array: char
specialized-array: int
specialized-array: ushort
in: classes.struct.tests
symbol: struct-test-empty
@ -277,7 +277,7 @@ STRUCT: struct-test-array-slots
STRUCT: struct-test-optimization
{ x { int 3 } } { y int } ;
SPECIALIZED-ARRAY: struct-test-optimization
specialized-array: struct-test-optimization
{ t } [ [ struct-test-optimization memory>struct y>> ] { memory>struct y>> } inlined? ] unit-test
{ t } [
@ -469,7 +469,7 @@ CONSULT: struct-test-delegate struct-test-delegator del>> ;
8 >>b
] unit-test
SPECIALIZED-ARRAY: void*
specialized-array: void*
STRUCT: silly-array-field-test { x int*[3] } ;

View File

@ -12,7 +12,7 @@ specialized-arrays stack-checker.dependencies summary vectors
vocabs.loader vocabs.parser words ;
in: classes.struct
SPECIALIZED-ARRAY: uchar
specialized-array: uchar
ERROR: struct-must-have-slots ;

View File

@ -11,7 +11,7 @@ STRUCT: foo
{ z ushort }
{ w ushort } ;
SPECIALIZED-ARRAY: foo
specialized-array: foo
VECTORED-STRUCT: foo
{

View File

@ -4,7 +4,7 @@ compiler.codegen.gc-maps compiler.codegen.relocation cpu.architecture
cpu.x86 byte-arrays make namespaces kernel layouts math sequences
specialized-arrays system tools.test ;
QUALIFIED: vm
SPECIALIZED-ARRAY: uint
specialized-array: uint
in: compiler.codegen.gc-maps.tests
singleton: fake-cpu

View File

@ -7,8 +7,8 @@ math.private memory namespaces namespaces.private random parser quotations
sequences slots.private specialized-arrays stack-checker stack-checker.errors
system threads tools.test words ;
FROM: alien.c-types => float short ;
SPECIALIZED-ARRAY: float
SPECIALIZED-ARRAY: char
specialized-array: float
specialized-array: char
in: compiler.tests.alien
! Make sure that invalid inputs don't pass the stack checker

View File

@ -2,8 +2,8 @@ USING: compiler.units compiler.test kernel kernel.private memory
math math.private tools.test math.floats.private math.order fry
specialized-arrays sequences math.functions layouts literals ;
QUALIFIED-WITH: alien.c-types c ;
SPECIALIZED-ARRAY: c:float
SPECIALIZED-ARRAY: c:double
specialized-array: c:float
specialized-array: c:double
in: compiler.tests.float
[ 3.0 1 2 3 ] [ 1.0 2.0 [ float+ 1 2 3 ] compile-call ] unit-test

View File

@ -3,7 +3,7 @@ USING: classes.struct specialized-arrays alien.c-types sequences
compiler.units vocabs tools.test specialized-arrays.private ;
STRUCT: my-struct { x int } ;
SPECIALIZED-ARRAY: my-struct
specialized-array: my-struct
: my-word ( a -- b ) iota [ my-struct <struct-boa> ] my-struct-array{ } map-as ;
[ ] [

View File

@ -9,8 +9,8 @@ math.order math.private quotations sequences sequences.private sets
slots.private sorting specialized-arrays strings strings.private
system tools.test vectors vocabs words ;
FROM: math => float ;
SPECIALIZED-ARRAY: double
SPECIALIZED-ARRAY: void*
specialized-array: double
specialized-array: void*
in: compiler.tree.propagation.tests
! Arrays

View File

@ -7,7 +7,7 @@ compiler.codegen.relocation compiler.constants cpu.architecture
cpu.x86 cpu.x86.assembler cpu.x86.assembler.operands
cpu.x86.features kernel layouts locals make math namespaces
sequences specialized-arrays system vocabs ;
SPECIALIZED-ARRAY: uint
specialized-array: uint
in: cpu.x86.32
: x86-float-regs ( -- seq )

View File

@ -6,7 +6,7 @@ compiler.codegen.labels compiler.codegen.relocation
compiler.constants cpu.architecture cpu.x86 cpu.x86.assembler
cpu.x86.assembler.operands cpu.x86.features kernel layouts locals
math sequences specialized-arrays system vocabs ;
SPECIALIZED-ARRAY: uint
specialized-array: uint
in: cpu.x86.64
: param-reg ( n -- reg ) int-regs cdecl param-regs at nth ;

View File

@ -5,7 +5,7 @@ compiler.codegen.labels cpu.architecture cpu.x86.assembler
cpu.x86.assembler.operands init kernel math math.order
math.parser memoize namespaces sequences
specialized-arrays system math.bitwise combinators.smart ;
SPECIALIZED-ARRAY: uint
specialized-array: uint
in: cpu.x86.features
<PRIVATE

View File

@ -4,7 +4,7 @@ USING: alien.strings fry io.encodings.utf16n kernel
splitting windows windows.kernel32 windows.types system
environment alien.data sequences windows.errors
io.streams.memory io.encodings io specialized-arrays ;
SPECIALIZED-ARRAY: TCHAR
specialized-array: TCHAR
in: environment.windows
M: windows os-env ( key -- value )

View File

@ -4,7 +4,7 @@ USING: accessors classes.struct kernel destructors bit-arrays
sequences assocs specialized-arrays math namespaces
libc locals fry unix unix.linux.epoll unix.time io.ports
io.backend.unix io.backend.unix.multiplexers ;
SPECIALIZED-ARRAY: epoll-event
specialized-array: epoll-event
in: io.backend.unix.multiplexers.epoll
TUPLE: epoll-mx < mx events ;

View File

@ -4,7 +4,7 @@ USING: accessors alien.c-types alien.data combinators
destructors io.backend.unix libc kernel math.bitwise sequences
specialized-arrays unix unix.kqueue unix.time assocs
io.backend.unix.multiplexers classes.struct literals ;
SPECIALIZED-ARRAY: kevent
specialized-array: kevent
in: io.backend.unix.multiplexers.kqueue
TUPLE: kqueue-mx < mx events ;

View File

@ -6,8 +6,8 @@ io.encodings.utf8 io.files io.files.info io.files.info.unix
io.files.unix libc kernel math sequences specialized-arrays
system unix unix.getfsstat.macosx unix.statfs.macosx
unix.statvfs.macosx ;
SPECIALIZED-ARRAY: uint
SPECIALIZED-ARRAY: statfs64
specialized-array: uint
specialized-array: statfs64
in: io.files.info.unix.macosx
TUPLE: macosx-file-info < unix-file-info birth-time flags gen ;

View File

@ -7,7 +7,7 @@ io.files.types kernel libc literals math math.bitwise
sequences specialized-arrays strings system unix unix.ffi
unix.groups unix.stat unix.time unix.users vocabs ;
in: io.files.info.unix
SPECIALIZED-ARRAY: timeval
specialized-array: timeval
TUPLE: unix-file-system-info < file-system-info-tuple
block-size preferred-block-size

View File

@ -8,7 +8,7 @@ sequences splitting windows.errors fry
continuations destructors calendar ascii
combinators.short-circuit literals locals classes.struct
specialized-arrays alien.data libc windows.shell32 ;
SPECIALIZED-ARRAY: ushort
specialized-array: ushort
in: io.files.info.windows
:: round-up-to ( n multiple -- n' )

View File

@ -4,7 +4,7 @@ io.files.temp io.pathnames kernel math
memoize specialized-arrays system windows.errors
windows.kernel32 windows.ole32 windows.shell32
windows.types ;
SPECIALIZED-ARRAY: WCHAR
specialized-array: WCHAR
in: io.files.temp.windows
<PRIVATE

View File

@ -9,7 +9,7 @@ io.timeouts kernel libc literals locals math math.bitwise namespaces
sequences specialized-arrays system threads tr vectors windows
windows.errors windows.handles windows.kernel32 windows.shell32
windows.time windows.types windows.winsock ;
SPECIALIZED-ARRAY: ushort
specialized-array: ushort
in: io.files.windows
slot: file

Some files were not shown because too many files have changed in this diff Show More