Fixes #1670.
PRIVATE>
-GENERIC# time+ 1 ( time1 time2 -- time3 )
+GENERIC#: time+ 1 ( time1 time2 -- time3 )
M: timestamp time+
[ clone ] dip (time+) drop ;
: blocks-with-gc ( cfg -- bbs )
post-order [ insert-gc-check? ] filter ;
-GENERIC# gc-check-offsets* 1 ( call-index seen-allocation? insn n -- call-index seen-allocation? )
+GENERIC#: gc-check-offsets* 1 ( call-index seen-allocation? insn n -- call-index seen-allocation? )
:: gc-check-here ( call-index seen-allocation? insn insn-index -- call-index seen-allocation? )
seen-allocation? [ call-index , ] when
: [vector-op-checked] ( #dup quot -- quot )
'[ _ ndup [ @ ] { } make dup [ insn-available? ] all? ] ;
-GENERIC# >vector-op-cond 2 ( quot #pick #dup -- quotpair )
+GENERIC#: >vector-op-cond 2 ( quot #pick #dup -- quotpair )
M:: callable >vector-op-cond ( quot #pick #dup -- quotpair )
#dup quot [vector-op-checked] '[ 2drop @ ]
#dup '[ % _ nnip ]
] each
] simple-analysis ;
-GENERIC# visit-insn 1 ( insn disjoint-set -- )
+GENERIC#: visit-insn 1 ( insn disjoint-set -- )
M: ##copy visit-insn
[ [ dst>> ] [ src>> ] bi ] dip equate ;
[ ] [ [ "blah" "compiler.tests.redefine16" lookup-word forget ] with-compilation-unit ] unit-test
-[ ] [ "IN: compiler.tests.redefine16 GENERIC# blah 2 ( foo bar baz -- )" eval( -- ) ] unit-test
+[ ] [ "IN: compiler.tests.redefine16 GENERIC#: blah 2 ( foo bar baz -- )" eval( -- ) ] unit-test
[ ] [ "IN: compiler.tests.redefine16 USING: strings math arrays prettyprint ; M: string blah 1 + 3array . ;" eval( -- ) ] unit-test
-[ ] [ "IN: compiler.tests.redefine16 GENERIC# blah 2 ( foo bar baz -- x )" eval( -- ) ] unit-test
+[ ] [ "IN: compiler.tests.redefine16 GENERIC#: blah 2 ( foo bar baz -- x )" eval( -- ) ] unit-test
[ ] [ [ "blah" "compiler.tests.redefine16" lookup-word forget ] with-compilation-unit ] unit-test
: mailbox-peek ( mailbox -- obj )
data>> peek-back ;
-GENERIC# mailbox-get-timeout 1 ( mailbox timeout -- obj )
+GENERIC#: mailbox-get-timeout 1 ( mailbox timeout -- obj )
M: mailbox mailbox-get-timeout block-if-empty data>> pop-back ;
M: register modifier drop 0b11 ;
-GENERIC# n, 1 ( value n -- )
+GENERIC#: n, 1 ( value n -- )
M: integer n, >le % ;
M: byte n, [ value>> ] dip n, ;
: maybe-zero-extend ( reg imm -- reg' imm )
dup zero-extendable? [ [ 32-bit-version-of ] dip ] when ;
-GENERIC# (MOV-I) 1 ( dst src -- )
+GENERIC#: (MOV-I) 1 ( dst src -- )
M: register (MOV-I)
{
<PRIVATE
-GENERIC# JUMPcc 1 ( addr opcode -- )
+GENERIC#: JUMPcc 1 ( addr opcode -- )
M: integer JUMPcc extended-opcode, 4, ;
: SETcc ( dst opcode -- )
GENERIC: query-results ( query -- result-set )
GENERIC: #rows ( result-set -- n )
GENERIC: #columns ( result-set -- n )
-GENERIC# row-column 1 ( result-set column -- obj )
-GENERIC# row-column-typed 1 ( result-set column -- sql )
+GENERIC#: row-column 1 ( result-set column -- obj )
+GENERIC#: row-column-typed 1 ( result-set column -- sql )
GENERIC: advance-row ( result-set -- )
GENERIC: more-rows? ( result-set -- ? )
GENERIC: foo ( x -- y )
GENERIC: bar ( a -- b )
-GENERIC# whoa 1 ( s t -- w )
+GENERIC#: whoa 1 ( s t -- w )
PROTOCOL: baz foo { bar 0 } { whoa 1 } ;
: hello-test ( hello/goodbye -- array )
M: consult-method reset-word
[ call-next-method ] [ f "consultation" set-word-prop ] bi ;
-GENERIC# (consult-method-quot) 2 ( consultation quot word -- object )
+GENERIC#: (consult-method-quot) 2 ( consultation quot word -- object )
M: consultation (consult-method-quot)
'[ _ call _ execute ] nip ;
! Image Decode
-GENERIC# load-image* 1 ( obj class -- image )
+GENERIC#: load-image* 1 ( obj class -- image )
GENERIC: stream>image* ( stream class -- image )
[ dup stat-mode ] 2dip
[ bitor ] [ unmask ] if [ chmod ] unix-system-call drop ;
-GENERIC# file-mode? 1 ( obj mask -- ? )
+GENERIC#: file-mode? 1 ( obj mask -- ? )
M: integer file-mode? mask? ;
M: string file-mode? [ stat-mode ] dip mask? ;
{ [ os unix? ] [ "unix.ffi" ] }
} cond use-vocab >>
-GENERIC# with-port 1 ( addrspec port -- addrspec )
+GENERIC#: with-port 1 ( addrspec port -- addrspec )
! Addressing
<PRIVATE
[ drop file-info size>> ] 2bi
<limited-stream> ;
-GENERIC# limit-stream 1 ( stream limit -- stream' )
+GENERIC#: limit-stream 1 ( stream limit -- stream' )
M: decoder limit-stream ( stream limit -- stream' )
'[ stream>> _ limit-stream ] [ code>> ] [ cr>> ] tri
f json-escape-unicode? set-global
! Writes the object out to a stream in JSON format
-GENERIC# stream-json-print 1 ( obj stream -- )
+GENERIC#: stream-json-print 1 ( obj stream -- )
: json-print ( obj -- )
output-stream get stream-json-print ;
IN: listener
GENERIC: stream-read-quot ( stream -- quot/f )
-GENERIC# prompt. 1 ( stream prompt -- )
+GENERIC#: prompt. 1 ( stream prompt -- )
: prompt ( -- str )
manifest get current-vocab>> [ name>> "IN: " prepend ] [ "" ] if*
GENERIC: lambda-generic ( a b -- c )
-GENERIC# lambda-generic-1 1 ( a b -- c )
+GENERIC#: lambda-generic-1 1 ( a b -- c )
M:: integer lambda-generic-1 ( a b -- c ) a b * ;
M:: integer lambda-generic ( a b -- c ) a b lambda-generic-1 ;
-GENERIC# lambda-generic-2 1 ( a b -- c )
+GENERIC#: lambda-generic-2 1 ( a b -- c )
M:: integer lambda-generic-2 ( a b -- c )
a CHAR: x <string> b lambda-generic ;
GENERIC: (set-fp-env-register) ( fp-env -- )
GENERIC: (get-exception-flags) ( fp-env -- exceptions )
-GENERIC# (set-exception-flags) 1 ( fp-env exceptions -- fp-env )
+GENERIC#: (set-exception-flags) 1 ( fp-env exceptions -- fp-env )
GENERIC: (get-fp-traps) ( fp-env -- exceptions )
-GENERIC# (set-fp-traps) 1 ( fp-env exceptions -- fp-env )
+GENERIC#: (set-fp-traps) 1 ( fp-env exceptions -- fp-env )
GENERIC: (get-rounding-mode) ( fp-env -- mode )
-GENERIC# (set-rounding-mode) 1 ( fp-env mode -- fp-env )
+GENERIC#: (set-rounding-mode) 1 ( fp-env mode -- fp-env )
GENERIC: (get-denormal-mode) ( fp-env -- mode )
-GENERIC# (set-denormal-mode) 1 ( fp-env mode -- fp-env )
+GENERIC#: (set-denormal-mode) 1 ( fp-env mode -- fp-env )
: change-fp-env-registers ( quot -- )
(fp-env-registers) swap [ (set-fp-env-register) ] compose each ; inline
: (^n) ( z w -- z^w )
dup fixnum? [ (^fixnum) ] [ (^bignum) ] if ; inline
-GENERIC# ^n 1 ( z w -- z^w ) foldable
+GENERIC#: ^n 1 ( z w -- z^w ) foldable
M: fixnum ^n (^n) ;
DEFER: copysign
-GENERIC# ldexp 1 ( x exp -- y )
+GENERIC#: ldexp 1 ( x exp -- y )
M: float ldexp
over fp-special? [ over zero? ] unless* [ drop ] [
GENERIC: vneg ( v -- w )
M: object vneg [ neg ] map ; inline
-GENERIC# v+n 1 ( v n -- w )
+GENERIC#: v+n 1 ( v n -- w )
M: object v+n [ + ] curry map ; inline
GENERIC: n+v ( n v -- w )
M: object n+v [ + ] with map ; inline
-GENERIC# v-n 1 ( v n -- w )
+GENERIC#: v-n 1 ( v n -- w )
M: object v-n [ - ] curry map ; inline
GENERIC: n-v ( n v -- w )
M: object n-v [ - ] with map ; inline
-GENERIC# v*n 1 ( v n -- w )
+GENERIC#: v*n 1 ( v n -- w )
M: object v*n [ * ] curry map ; inline
GENERIC: n*v ( n v -- w )
M: object n*v [ * ] with map ; inline
-GENERIC# v/n 1 ( v n -- w )
+GENERIC#: v/n 1 ( v n -- w )
M: object v/n [ / ] curry map ; inline
GENERIC: n/v ( n v -- w )
GENERIC: vbitnot ( v -- w )
M: object vbitnot [ bitnot ] map ; inline
-GENERIC# vbroadcast 1 ( u n -- v )
+GENERIC#: vbroadcast 1 ( u n -- v )
M:: object vbroadcast ( u n -- v ) u length n u nth <repetition> u like ; inline
-GENERIC# vshuffle-elements 1 ( v perm -- w )
+GENERIC#: vshuffle-elements 1 ( v perm -- w )
M: object vshuffle-elements
over length 0 pad-tail
swap [ '[ _ nth ] ] keep map-as ; inline
-GENERIC# vshuffle2-elements 1 ( u v perm -- w )
+GENERIC#: vshuffle2-elements 1 ( u v perm -- w )
M: object vshuffle2-elements
[ append ] dip vshuffle-elements ; inline
-GENERIC# vshuffle-bytes 1 ( v perm -- w )
+GENERIC#: vshuffle-bytes 1 ( v perm -- w )
GENERIC: vshuffle ( v perm -- w )
M: array vshuffle ( v perm -- w )
vshuffle-elements ; inline
-GENERIC# vlshift 1 ( v n -- w )
+GENERIC#: vlshift 1 ( v n -- w )
M: object vlshift '[ _ shift ] map ; inline
-GENERIC# vrshift 1 ( v n -- w )
+GENERIC#: vrshift 1 ( v n -- w )
M: object vrshift neg '[ _ shift ] map ; inline
-GENERIC# hlshift 1 ( v n -- w )
-GENERIC# hrshift 1 ( v n -- w )
+GENERIC#: hlshift 1 ( v n -- w )
+GENERIC#: hrshift 1 ( v n -- w )
GENERIC: (vmerge-head) ( u v -- h )
M: object (vmerge-head) over length 2 /i '[ _ head-slice ] bi@ [ zip ] keep concat-as ; inline
SYMBOL: secure-random-generator
SYMBOL: random-generator
-GENERIC# seed-random 1 ( obj seed -- obj )
+GENERIC#: seed-random 1 ( obj seed -- obj )
GENERIC: random-32* ( obj -- n )
GENERIC: random-bytes* ( n obj -- byte-array )
[ 32 shift obj random-32* + ] [ 32 + ] [ 32 - ] tri*
] while drop [ m * ] [ neg shift ] bi* ; inline
-GENERIC# (random-integer) 1 ( m obj -- n )
+GENERIC#: (random-integer) 1 ( m obj -- n )
M: fixnum (random-integer) ( m obj -- n ) random-integer-loop ;
M: bignum (random-integer) ( m obj -- n ) random-integer-loop ;
TUPLE: condition question yes no ;
C: <condition> condition
-GENERIC# answer 2 ( class from to -- new-class )
+GENERIC#: answer 2 ( class from to -- new-class )
M:: object answer ( class from to -- new-class )
class from = to class ? ;
M: not-class answer
[ class>> ] 2dip answer <not-class> ;
-GENERIC# substitute 1 ( class from to -- new-class )
+GENERIC#: substitute 1 ( class from to -- new-class )
M: object substitute answer ;
M: not-class substitute [ <not-class> ] bi@ answer ;
[ check-annotate-twice ] dip
[ dup def>> 2dup "unannotated-def" set-word-prop ] dip ;
-GENERIC# (annotate) 1 ( word quot -- )
+GENERIC#: (annotate) 1 ( word quot -- )
M: generic (annotate)
'[ _ (annotate) ] annotate-generic ;
prepare-annotate
call( old -- new ) define ;
-GENERIC# (deep-annotate) 1 ( word quot -- )
+GENERIC#: (deep-annotate) 1 ( word quot -- )
M: generic (deep-annotate)
'[ _ (deep-annotate) ] annotate-generic ;
SYMBOL: visited
-GENERIC# quot-uses 1 ( obj set -- )
+GENERIC#: quot-uses 1 ( obj set -- )
M: object quot-uses 2drop ;
[ T{ rgba f 0.0 0.0 0.0 0.0 } ]
[ T{ rgba f 1.0 1.0 1.0 1.0 } ] if ;
-GENERIC# apply-world-attributes 1 ( world attributes -- world )
+GENERIC#: apply-world-attributes 1 ( world attributes -- world )
M: world apply-world-attributes
{
GENERIC: world-pixel-format-attributes ( world -- attributes )
-GENERIC# check-world-pixel-format 1 ( world pixel-format -- )
+GENERIC#: check-world-pixel-format 1 ( world pixel-format -- )
M: method completion-string method-completion-string ;
-GENERIC# accept-completion-hook 1 ( item popup -- )
+GENERIC#: accept-completion-hook 1 ( item popup -- )
: insert-completion ( item popup -- )
[ completion-string ] [ completion-loc/doc/elt ] bi* set-elt-string ;
: gadget-at-path ( parent path -- gadget )
[ swap nth-gadget ] each ;
-GENERIC# leaves* 1 ( tree set -- )
+GENERIC#: leaves* 1 ( tree set -- )
M: node leaves* [ children>> ] dip leaves* ;
! /proc/pid/*
-GENERIC# proc-pid-path 1 ( object string -- path )
+GENERIC#: proc-pid-path 1 ( object string -- path )
M: integer proc-pid-path ( pid string -- path )
[ "/proc/" ] 2dip
system system.private ;
IN: alien.strings
-GENERIC# alien>string 1 ( c-ptr encoding -- string/f )
+GENERIC#: alien>string 1 ( c-ptr encoding -- string/f )
M: c-ptr alien>string
[ <memory-stream> ] [ <decoder> ] bi*
: check-string ( string -- )
0 over member-eq? [ invalid-c-string ] [ drop ] if ;
-GENERIC# string>alien 1 ( string encoding -- byte-array )
+GENERIC#: string>alien 1 ( string encoding -- byte-array )
M: c-ptr string>alien drop ;
"DEFER:"
"ERROR:"
"FORGET:"
- "GENERIC#"
+ "GENERIC#:"
"GENERIC:"
"HOOK:"
"H{"
new BV{ } clone >>bytes ;
GENERIC: initialize-checksum-state ( checksum -- checksum-state )
-GENERIC# add-checksum-bytes 1 ( checksum-state data -- checksum-state )
+GENERIC#: add-checksum-bytes 1 ( checksum-state data -- checksum-state )
GENERIC: get-checksum ( checksum-state -- value )
: with-checksum-state ( ..a checksum quot: ( ..a checksum-state -- ..b ) -- ..b )
: parse-slot-values ( class slots -- values )
[ (parse-slot-values) ] { } make ;
-GENERIC# boa>object 1 ( class slots -- tuple )
+GENERIC#: boa>object 1 ( class slots -- tuple )
M: tuple-class boa>object
swap slots>tuple ;
] with-compilation-unit
! rapido found this one
-GENERIC# m1 0 ( s n -- n )
-GENERIC# m2 1 ( s n -- v )
+GENERIC#: m1 0 ( s n -- n )
+GENERIC#: m2 1 ( s n -- v )
TUPLE: t1 ;
dup final-class? [ bad-superclass ] when
dup class? [ bad-superclass ] unless drop ;
-GENERIC# (define-tuple-class) 2 ( class superclass slots -- )
+GENERIC#: (define-tuple-class) 2 ( class superclass slots -- )
: thrower-effect ( slots -- effect )
[ name>> ] map { "*" } <effect> ;
"A table of built-in method combination defining words, and the method combinations themselves:"
{ $table
{ { $link POSTPONE: GENERIC: } { $link standard-combination } }
- { { $link POSTPONE: GENERIC# } { $link standard-combination } }
+ { { $link POSTPONE: GENERIC#: } { $link standard-combination } }
{ { $link POSTPONE: HOOK: } { $link hook-combination } }
{ { $link POSTPONE: MATH: } { $link math-combination } }
}
"Generic words which dispatch on the object at the top of the stack:"
{ $subsections POSTPONE: GENERIC: }
"A method combination which dispatches on a specified stack position:"
-{ $subsections POSTPONE: GENERIC# }
+{ $subsections POSTPONE: GENERIC#: }
"A method combination which dispatches on the value of a variable at the time the generic word is called:"
{ $subsections POSTPONE: HOOK: }
"A method combination which dispatches on a pair of stack values, which must be numbers, and upgrades both to the same type of number:"
HELP: generic
{ $class-description "The class of generic words, documented in " { $link "generic" } "." } ;
-{ generic define-generic define-simple-generic POSTPONE: GENERIC: POSTPONE: GENERIC# POSTPONE: MATH: POSTPONE: HOOK: } related-words
+{ generic define-generic define-simple-generic POSTPONE: GENERIC: POSTPONE: GENERIC#: POSTPONE: MATH: POSTPONE: HOOK: } related-words
HELP: make-generic
{ $values { "word" generic } }
[ call-next-method ] bi
] if ;
-GENERIC# check-combination-effect 1 ( combination effect -- )
+GENERIC#: check-combination-effect 1 ( combination effect -- )
M: object check-combination-effect 2drop ;
{ $examples
"A generic word for append strings and characters to a sequence, dispatching on the object underneath the top of the stack:"
{ $code
- "GENERIC# build-string 1 ( elt str -- )"
+ "GENERIC#: build-string 1 ( elt str -- )"
"M: string build-string swap push-all ;"
"M: integer build-string push ;"
}
] must-fail
{ } [ "IN: generic.standard.tests GENERIC: unhappy ( x -- x )" eval( -- ) ] unit-test
-GENERIC# complex-combination 1 ( a b -- c )
+GENERIC#: complex-combination 1 ( a b -- c )
M: string complex-combination drop ;
M: object complex-combination nip ;
[ "IN: generic.standard.tests GENERIC: broken-generic ( -- )" eval( -- ) ]
[ error>> bad-dispatch-position? ]
must-fail-with
-[ "IN: generic.standard.tests GENERIC# broken-generic# -1 ( a -- b )" eval( -- ) ]
+[ "IN: generic.standard.tests GENERIC#: broken-generic# -1 ( a -- b )" eval( -- ) ]
[ error>> bad-dispatch-position? ]
must-fail-with
-[ "IN: generic.standard.tests GENERIC# broken-generic# 1 ( a -- b )" eval( -- ) ]
+[ "IN: generic.standard.tests GENERIC#: broken-generic# 1 ( a -- b )" eval( -- ) ]
[ error>> bad-dispatch-position? ]
must-fail-with
-[ "IN: generic.standard.tests GENERIC# broken-generic# 2/3 ( a b c -- )" eval( -- ) ]
+[ "IN: generic.standard.tests GENERIC#: broken-generic# 2/3 ( a b c -- )" eval( -- ) ]
[ error>> bad-dispatch-position? ]
must-fail-with
M: standard-combination mega-cache-quot
combination get #>> make-empty-cache \ mega-cache-lookup [ ] 4sequence ;
-M: standard-generic definer drop \ GENERIC# f ;
+M: standard-generic definer drop \ GENERIC#: f ;
M: simple-generic definer drop \ GENERIC: f ;
PRIVATE>
-GENERIC# re-encode 1 ( stream encoding -- newstream )
+GENERIC#: re-encode 1 ( stream encoding -- newstream )
M: object re-encode <encoder> ;
[ [ output-stream get ] dip re-encode ] dip
with-output-stream* ; inline
-GENERIC# re-decode 1 ( stream encoding -- newstream )
+GENERIC#: re-decode 1 ( stream encoding -- newstream )
M: object re-decode <decoder> ;
: ascii-string>utf16be ( string stream -- )
[ 1 swap ascii-string>utf16-byte-array ] dip stream-write ; inline
-GENERIC# encode-string-utf16le 1 ( string stream -- )
+GENERIC#: encode-string-utf16le 1 ( string stream -- )
M: object encode-string-utf16le
[ char>utf16le ] curry each ; inline
M: utf16le encode-string drop encode-string-utf16le ;
-GENERIC# encode-string-utf16be 1 ( string stream -- )
+GENERIC#: encode-string-utf16be 1 ( string stream -- )
M: object encode-string-utf16be
[ char>utf16be ] curry each ; inline
M: utf8 encode-char
drop char>utf8 ;
-GENERIC# encode-string-utf8 1 ( string stream -- )
+GENERIC#: encode-string-utf8 1 ( string stream -- )
M: object encode-string-utf8
[ char>utf8 ] curry each ; inline
MATH: bitand ( x y -- z ) foldable
MATH: bitor ( x y -- z ) foldable
MATH: bitxor ( x y -- z ) foldable
-GENERIC# shift 1 ( x n -- y ) foldable
+GENERIC#: shift 1 ( x n -- y ) foldable
GENERIC: bitnot ( x -- y ) foldable
-GENERIC# bit? 1 ( x n -- ? ) foldable
+GENERIC#: bit? 1 ( x n -- ? ) foldable
GENERIC: abs ( x -- y ) foldable
PRIVATE>
-GENERIC# >base 1 ( n radix -- str )
+GENERIC#: >base 1 ( n radix -- str )
: number>string ( n -- str ) 10 >base ; inline
{
"IN: parser.tests"
"USING: math arrays kernel ;"
- "GENERIC# change-combination 1 ( obj a -- b )"
+ "GENERIC#: change-combination 1 ( obj a -- b )"
"M: integer change-combination 2drop 1 ;"
"M: array change-combination 2drop 2 ;"
} "\n" join <string-reader> "change-combination-test" parse-stream drop
ERROR: bounds-error index seq ;
-GENERIC# bounds-check? 1 ( n seq -- ? )
+GENERIC#: bounds-check? 1 ( n seq -- ? )
M: integer bounds-check? ( n seq -- ? )
dupd length < [ 0 >= ] [ drop f ] if ; inline
[ 2drop make-inline ]
3tri ;
-GENERIC# reader-quot 1 ( class slot-spec -- quot )
+GENERIC#: reader-quot 1 ( class slot-spec -- quot )
M: object reader-quot
nip [
\ unless ,
] [ ] make ;
-GENERIC# writer-quot 1 ( class slot-spec -- quot )
+GENERIC#: writer-quot 1 ( class slot-spec -- quot )
M: object writer-quot
nip
{ $values { "word" "a new word to define" } }
{ $description "Defines a new generic word in the current vocabulary. Initially, it contains no methods, and thus will throw a " { $link no-method } " error when called." } ;
-HELP: GENERIC#
-{ $syntax "GENERIC# word n ( stack -- effect )" }
+HELP: GENERIC#:
+{ $syntax "GENERIC#: word n ( stack -- effect )" }
{ $values { "word" "a new word to define" } { "n" "the stack position to dispatch on" } }
{ $description "Defines a new generic word which dispatches on the " { $snippet "n" } "th most element from the top of the stack in the current vocabulary. Initially, it contains no methods, and thus will throw a " { $link no-method } " error when called." }
{ $notes
"The following two definitions are equivalent:"
{ $code "GENERIC: foo ( obj -- )" }
- { $code "GENERIC# foo 0 ( obj -- )" }
+ { $code "GENERIC#: foo 0 ( obj -- )" }
} ;
HELP: MATH:
[ simple-combination ] (GENERIC:)
] define-core-syntax
- "GENERIC#" [
+ "GENERIC#:" [
[ scan-number <standard-combination> ] (GENERIC:)
] define-core-syntax
: insn ( bitspec -- ) bitfield (insn) ; inline
! Branching instructions
-GENERIC# (B) 1 ( target l -- )
+GENERIC#: (B) 1 ( target l -- )
M: integer (B) { 24 { 1 25 } { 0 26 } { 1 27 } 0 } insn ;
: sinsn ( bitspec -- )
bitfield S> [ 20 2^ bitor ] when (insn) ; inline
-GENERIC# shift-imm/reg 2 ( shift-imm/Rs Rm shift -- n )
+GENERIC#: shift-imm/reg 2 ( shift-imm/Rs Rm shift -- n )
M: integer shift-imm/reg ( shift-imm Rm shift -- n )
{ { 0 4 } 5 { register 0 } 7 } bitfield ;
<PRIVATE
-GENERIC# (BX) 1 ( Rm l -- )
+GENERIC#: (BX) 1 ( Rm l -- )
M: register-class (BX) ( Rm l -- )
{
MIXIN: random-access-cursor
INSTANCE: random-access-cursor bidirectional-cursor
-GENERIC# cursor+ 1 ( cursor n -- cursor' )
-GENERIC# cursor- 1 ( cursor n -- cursor' )
+GENERIC#: cursor+ 1 ( cursor n -- cursor' )
+GENERIC#: cursor- 1 ( cursor n -- cursor' )
GENERIC: cursor-distance ( cursor cursor -- n )
GENERIC: cursor< ( cursor cursor -- ? )
GENERIC: cursor> ( cursor cursor -- ? )
: new-growable-cursor ( begin end exemplar -- cursor result )
[ swap cursor-distance-hint ] dip new-resizable [ <pusher-cursor> ] keep ; inline
-GENERIC# new-sequence-cursor 1 ( begin end exemplar -- cursor result )
+GENERIC#: new-sequence-cursor 1 ( begin end exemplar -- cursor result )
M: random-access-cursor new-sequence-cursor
[ swap cursor-distance ] dip new-sequence [ begin-cursor ] keep ; inline
[ draw-timer>> iteration-start-nanos>> nano-count swap - ]
[ tick-interval-nanos>> ] bi /f 1.0 min ;
-GENERIC# record-benchmarking 1 ( loop quot -- )
+GENERIC#: record-benchmarking 1 ( loop quot -- )
M: object record-benchmarking
call( loop -- ) ;
PRIVATE>
-GENERIC# load-models* 2 ( obj encoding class -- models )
+GENERIC#: load-models* 2 ( obj encoding class -- models )
GENERIC: stream>models ( stream class -- models )
: wrap ( n seq -- n seq ) [ length rem ] keep ; inline
-GENERIC# (gml-get) 1 ( collection key -- elt )
+GENERIC#: (gml-get) 1 ( collection key -- elt )
M: sequence (gml-get) swap wrap nth ;
M: hashtable (gml-get) of ;
-GENERIC# (gml-put) 2 ( collection key elt -- )
+GENERIC#: (gml-put) 2 ( collection key elt -- )
M:: sequence (gml-put) ( collection key elt -- )
elt key collection wrap set-nth ;
M: system-framebuffer framebuffer-handle drop 0 ;
M: framebuffer framebuffer-handle handle>> ;
-GENERIC# allocate-framebuffer-attachment 1 ( framebuffer-attachment dim -- )
+GENERIC#: allocate-framebuffer-attachment 1 ( framebuffer-attachment dim -- )
M: texture-attachment allocate-framebuffer-attachment
[ [ texture>> ] [ level>> ] bi ] dip f allocate-texture ;
GENERIC: render-vertex-indexes ( primitive-mode vertex-indexes -- )
-GENERIC# render-vertex-indexes-instanced 1 ( primitive-mode vertex-indexes instances -- )
+GENERIC#: render-vertex-indexes-instanced 1 ( primitive-mode vertex-indexes instances -- )
GENERIC: gl-array-element-type ( array -- type )
M: uchar-array gl-array-element-type drop GL_UNSIGNED_BYTE ; inline
GENERIC: >uniform-uint-array ( sequence -- c-array )
GENERIC: >uniform-float-array ( sequence -- c-array )
-GENERIC# >uniform-bvec-array 1 ( sequence dim -- c-array )
-GENERIC# >uniform-ivec-array 1 ( sequence dim -- c-array )
-GENERIC# >uniform-uvec-array 1 ( sequence dim -- c-array )
-GENERIC# >uniform-vec-array 1 ( sequence dim -- c-array )
+GENERIC#: >uniform-bvec-array 1 ( sequence dim -- c-array )
+GENERIC#: >uniform-ivec-array 1 ( sequence dim -- c-array )
+GENERIC#: >uniform-uvec-array 1 ( sequence dim -- c-array )
+GENERIC#: >uniform-vec-array 1 ( sequence dim -- c-array )
-GENERIC# >uniform-matrix 2 ( sequence cols rows -- c-array )
+GENERIC#: >uniform-matrix 2 ( sequence cols rows -- c-array )
-GENERIC# >uniform-matrix-array 2 ( sequence cols rows -- c-array )
+GENERIC#: >uniform-matrix-array 2 ( sequence cols rows -- c-array )
GENERIC: bind-uniform-bvec2 ( index sequence -- )
GENERIC: bind-uniform-bvec3 ( index sequence -- )
PRIVATE>
-GENERIC# allocate-texture 3 ( tdt level dim data -- )
+GENERIC#: allocate-texture 3 ( tdt level dim data -- )
M: texture-1d-data-target allocate-texture ( tdt level dim data -- )
[ ] [ glTexImage1D ] (allocate-texture) ;
M: texture-3d-data-target allocate-texture ( tdt level dim data -- )
[ first3 ] [ glTexImage3D ] (allocate-texture) ;
-GENERIC# allocate-compressed-texture 3 ( tdt level dim compressed-data -- )
+GENERIC#: allocate-compressed-texture 3 ( tdt level dim compressed-data -- )
M: texture-1d-data-target allocate-compressed-texture ( tdt level dim compressed-data -- )
[ ] [ glCompressedTexImage1D ] (allocate-compressed-texture) ;
M: texture-3d-data-target allocate-compressed-texture ( tdt level dim compressed-data -- )
[ first3 ] [ glCompressedTexImage3D ] (allocate-compressed-texture) ;
-GENERIC# update-texture 4 ( tdt level loc dim data -- )
+GENERIC#: update-texture 4 ( tdt level loc dim data -- )
M: texture-1d-data-target update-texture ( tdt level loc dim data -- )
[ ] [ glTexSubImage1D ] (update-texture) ;
M: texture-3d-data-target update-texture ( tdt level loc dim data -- )
[ first3 ] [ glTexSubImage3D ] (update-texture) ;
-GENERIC# update-compressed-texture 4 ( tdt level loc dim compressed-data -- )
+GENERIC#: update-compressed-texture 4 ( tdt level loc dim compressed-data -- )
M: texture-1d-data-target update-compressed-texture ( tdt level loc dim compressed-data -- )
[ ] [ glCompressedTexSubImage1D ] (update-compressed-texture) ;
{ [ dim>> ] [ bitmap>> ] [ component-order>> ] [ component-type>> ] } cleave
<texture-data> ; inline
-GENERIC# texture-dim 1 ( tdt level -- dim )
+GENERIC#: texture-dim 1 ( tdt level -- dim )
M:: texture-1d-data-target texture-dim ( tdt level -- dim )
tdt bind-tdt :> texture
<PRIVATE
-! GENERIC# =attr 1 ( graphviz-obj val -- graphviz-obj' )
+! GENERIC#: =attr 1 ( graphviz-obj val -- graphviz-obj' )
! M: edge/node =attr
! present over attributes>> attr<< ;
! M: sub/graph =attr
IN: monads
! Functors
-GENERIC# fmap 1 ( functor quot -- functor' )
-GENERIC# <$ 1 ( functor quot -- functor' )
-GENERIC# $> 1 ( functor quot -- functor' )
+GENERIC#: fmap 1 ( functor quot -- functor' )
+GENERIC#: <$ 1 ( functor quot -- functor' )
+GENERIC#: $> 1 ( functor quot -- functor' )
! Monads
: key-spec ( spec-quot -- spec-assoc )
output>array >hashtable ; inline
-GENERIC# hint 1 ( mdb-query-msg index-hint -- mdb-query-msg )
+GENERIC#: hint 1 ( mdb-query-msg index-hint -- mdb-query-msg )
M: mdb-query-msg hint
>>hint ;
[ [ two>> ] [ three>> ] bi ] 2dip bi* ; inline
GENERIC: merge ( t t -- t )
-GENERIC# block-merge 1 ( t t -- t )
-GENERIC# end-merge 1 ( t t -- t )
+GENERIC#: block-merge 1 ( t t -- t )
+GENERIC#: end-merge 1 ( t t -- t )
M: block merge block-merge ;
M: end merge end-merge ;
M: block block-merge [ [ two>> ] bi@ merge ]
[ dns-AAAA-query aaaa-message. ]
[ dns-MX-query mx-message. ] tri ;
-GENERIC# dns-host 1 ( servers domain -- )
+GENERIC#: dns-host 1 ( servers domain -- )
M: sequence dns-host ( servers domain -- )
'[ _ host ] with-dns-servers ;
MACRO: unboa ( class -- quot )
<wrapper> \ boa [ ] 2sequence [undo] ;
-GENERIC# (match-branch) 1 ( class quot -- class quot' )
+GENERIC#: (match-branch) 1 ( class quot -- class quot' )
M: singleton-class (match-branch)
\ drop prefix ;
: <zmq_msg_t> ( -- byte-array )
zmq-msg-size (byte-array) ;
-GENERIC# zmq-setopt 2 ( obj name value -- )
-GENERIC# zmq-getopt 1 ( obj name -- value )
+GENERIC#: zmq-setopt 2 ( obj name value -- )
+GENERIC#: zmq-getopt 1 ( obj name -- value )
TUPLE: zmq-message underlying ;
M: gadget >layout f <layout> ;
M: layout >layout ;
-GENERIC# (add-gadget-at) 2 ( parent item n -- )
+GENERIC#: (add-gadget-at) 2 ( parent item n -- )
M: gadget (add-gadget-at) -rot [ add-gadget ] keep insert-gadget ;
M: track (add-gadget-at) -rot >layout [ add-layout ] keep [ gadget>> insert-gadget ] [ size>> insert-size ] 3bi ;
-GENERIC# add-gadget-at 1 ( item location -- )
+GENERIC#: add-gadget-at 1 ( item location -- )
M: object add-gadget-at insertion-point -rot (add-gadget-at) ;
M: model add-gadget-at parent>> dup book:book? [ "No models in books" throw ]
[ dup model>> dup collection? [ nip swap add-connection ] [ drop [ 1array <collection> ] dip model<< ] if ] if ;