- Allow methods to dispatch off union{ } and intersection{ } classes.
- Add not{ } anonymous-complement syntax.
- Define class-name for anonymous-union/intersection/complement and maybes, and clean up pprint.
- Change maybe: foo to maybe{ foo }
- Call sort-classes when making anonymous-union/anonymous-intersection classes so that they are canonicalized.
UNION: foo integer yoo ;
-TUPLE: redefine-test-26 { a maybe: foo } ;
+TUPLE: redefine-test-26 { a maybe{ foo } } ;
: store-26 ( -- obj ) redefine-test-26 new 26 >>a ;
: store-26. ( -- obj ) redefine-test-26 new 26. >>a ;
] unit-test
[ t ] [
- [ maybe: integer instance? ] { instance? } inlined?
+ [ maybe{ integer } instance? ] { instance? } inlined?
] unit-test
TUPLE: inline-please a ;
[ t ] [
- [ maybe: inline-please instance? ] { instance? } inlined?
+ [ maybe{ inline-please } instance? ] { instance? } inlined?
] unit-test
GENERIC: derp ( obj -- obj' )
[ t ]
[
- [ dup maybe: integer instance? [ derp ] when ] { instance? } inlined?
+ [ dup maybe{ integer } instance? [ derp ] when ] { instance? } inlined?
] unit-test
summary vocabs.loader ;
IN: dlists
-TUPLE: dlist-link { prev maybe: dlist-link } { next maybe: dlist-link } ;
+TUPLE: dlist-link { prev maybe{ dlist-link } } { next maybe{ dlist-link } } ;
TUPLE: dlist-node < dlist-link obj ;
\ dlist-node new-dlist-link ; inline
TUPLE: dlist
-{ front maybe: dlist-link }
-{ back maybe: dlist-link } ;
+{ front maybe{ dlist-link } }
+{ back maybe{ dlist-link } } ;
: <dlist> ( -- list )
dlist new ; inline
SLOT: port
-TUPLE: ipv4 { host maybe: string read-only } ;
+TUPLE: ipv4 { host maybe{ string } read-only } ;
<PRIVATE
M: inet4 protocol drop 0 ;
TUPLE: ipv6
-{ host maybe: string read-only }
+{ host maybe{ string } read-only }
{ scope-id integer read-only } ;
<PRIVATE
HOOK: resolve-localhost os ( -- obj )
-TUPLE: hostname { host maybe: string read-only } ;
+TUPLE: hostname { host maybe{ string } read-only } ;
TUPLE: inet < hostname port ;
hash-sets hashtables io io.pathnames io.styles kernel
make math math.order math.parser namespaces prettyprint.config
prettyprint.custom prettyprint.sections prettyprint.stylesheet
-quotations sbufs sequences strings vectors words words.symbol ;
+quotations sbufs sequences strings vectors words words.symbol
+classes.private ;
FROM: sets => members ;
+! QUALIFIED-WITH: classes.not cn
IN: prettyprint.backend
M: effect pprint* effect>string text ;
GENERIC: word-name* ( obj -- str )
M: maybe word-name*
- class>> word-name* "maybe: " prepend ;
+ class-name "maybe{ " " }" surround ;
+
+M: anonymous-complement word-name*
+ class-name "not{ " " }" surround ;
M: anonymous-union word-name*
- members>> [ word-name* ] map " " join "union{ " " }" surround ;
+ class-name "union{ " " }" surround ;
M: anonymous-intersection word-name*
- participants>> [ word-name* ] map " " join "intersection{ " " }" surround ;
+ class-name "intersection{ " " }" surround ;
M: word word-name* ( word -- str )
[ name>> "( no name )" or ] [ record-vocab ] bi ;
M: hash-set pprint-delims drop \ HS{ \ } ;
M: anonymous-union pprint-delims drop \ union{ \ } ;
M: anonymous-intersection pprint-delims drop \ intersection{ \ } ;
+M: anonymous-complement pprint-delims drop \ not{ \ } ;
+M: maybe pprint-delims drop \ maybe{ \ } ;
M: object >pprint-sequence ;
M: vector >pprint-sequence ;
M: hash-set >pprint-sequence members ;
M: anonymous-union >pprint-sequence members>> ;
M: anonymous-intersection >pprint-sequence participants>> ;
+M: anonymous-complement >pprint-sequence class>> 1array ;
+M: maybe >pprint-sequence class>> 1array ;
: class-slot-sequence ( class slots -- sequence )
[ 1array ] [ [ f 2array ] dip append ] if-empty ;
M: hash-set pprint* pprint-object ;
M: anonymous-union pprint* pprint-object ;
M: anonymous-intersection pprint* pprint-object ;
+M: anonymous-complement pprint* pprint-object ;
+M: maybe pprint* pprint-object ;
M: wrapper pprint*
{
{ [ dup wrapped>> word? ] [ <block \ \ pprint-word wrapped>> pprint-word block> ] }
[ pprint-object ]
} cond ;
-
-M: maybe pprint*
- <block \ maybe: pprint-word class>> pprint-class block> ;
] with-variable
] unit-test
-[ "maybe: integer\n" ] [ [ maybe: integer . ] with-string-writer ] unit-test
+[ "maybe{ integer }\n" ] [ [ maybe{ integer } . ] with-string-writer ] unit-test
TUPLE: bob a b ;
-[ "maybe: bob\n" ] [ [ maybe: bob . ] with-string-writer ] unit-test
-[ "maybe: word\n" ] [ [ maybe: word . ] with-string-writer ] unit-test
+[ "maybe{ bob }\n" ] [ [ maybe{ bob } . ] with-string-writer ] unit-test
+[ "maybe{ word }\n" ] [ [ maybe{ word } . ] with-string-writer ] unit-test
TUPLE: har a ;
GENERIC: harhar ( obj -- obj )
-M: maybe: har harhar ;
+M: maybe{ har } harhar ;
M: integer harhar M\ integer harhar drop ;
[
"""USING: prettyprint.tests ;
-M: maybe: har harhar ;
+M: maybe{ har } harhar ;
USING: kernel math prettyprint.tests ;
M: integer harhar M\\ integer harhar drop ;\n"""
] [ [ intersection{ union{ float integer } intersection{ string hashtable } } . ] with-string-writer ] unit-test
[
-"""maybe: union{ float integer }\n"""
+"""maybe{ union{ float integer } }\n"""
] [
- [ maybe: union{ float integer } . ] with-string-writer
+ [ maybe{ union{ float integer } } . ] with-string-writer
] unit-test
[
-"""maybe: maybe: integer\n"""
+"""maybe{ maybe{ integer } }\n"""
] [
- [ maybe: maybe: integer . ] with-string-writer
+ [ maybe{ maybe{ integer } } . ] with-string-writer
] unit-test
[ ] [ [ \ forget-fail forget ] with-compilation-unit ] unit-test
-TYPED: typed-maybe ( x: maybe: integer -- ? ) >boolean ;
+TYPED: typed-maybe ( x: maybe{ integer } -- ? ) >boolean ;
[ f ] [ f typed-maybe ] unit-test
[ t ] [ 30 typed-maybe ] unit-test
"<<"
">>"
"call-next-method"
- "maybe:"
+ "not{"
+ "maybe{"
"union{"
"intersection{"
"initial:"
RENAME: members sets => set-members
IN: classes.algebra
+DEFER: sort-classes
+
<PRIVATE
TUPLE: anonymous-union { members read-only } ;
: <anonymous-union> ( members -- class )
[ null eq? not ] filter set-members
- dup length 1 = [ first ] [ anonymous-union boa ] if ;
+ dup length 1 = [ first ] [ sort-classes f like anonymous-union boa ] if ;
M: anonymous-union rank-class drop 6 ;
: <anonymous-intersection> ( participants -- class )
set-members dup length 1 =
- [ first ] [ anonymous-intersection boa ] if ;
+ [ first ] [ sort-classes f like anonymous-intersection boa ] if ;
M: anonymous-intersection rank-class drop 4 ;
M: anonymous-complement rank-class drop 3 ;
+M: anonymous-complement instance?
+ over [ class>> instance? not ] [ 2drop t ] if ;
+
+M: anonymous-complement class-name
+ class>> class-name ;
+
DEFER: (class<=)
DEFER: (class-not)
[ dup set ] each
] if-empty ;
+M: anonymous-intersection class-name
+ participants>> [ class-name ] map " " join ;
+
PRIVATE>
: define-intersection-class ( class participants -- )
math classes accessors slots classes.algebra ;
IN: classes.maybe.tests
-[ t ] [ 3 maybe: integer instance? ] unit-test
-[ t ] [ f maybe: integer instance? ] unit-test
-[ f ] [ 3.0 maybe: integer instance? ] unit-test
+[ t ] [ 3 maybe{ integer } instance? ] unit-test
+[ t ] [ f maybe{ integer } instance? ] unit-test
+[ f ] [ 3.0 maybe{ integer } instance? ] unit-test
-TUPLE: maybe-integer-container { something maybe: integer } ;
+TUPLE: maybe-integer-container { something maybe{ integer } } ;
[ f ] [ maybe-integer-container new something>> ] unit-test
[ 3 ] [ maybe-integer-container new 3 >>something something>> ] unit-test
[ maybe-integer-container new 3.0 >>something ] [ bad-slot-value? ] must-fail-with
-TUPLE: self-pointer { next maybe: self-pointer } ;
+TUPLE: self-pointer { next maybe{ self-pointer } } ;
[ T{ self-pointer { next T{ self-pointer } } } ]
[ self-pointer new self-pointer new >>next ] unit-test
-[ t ] [ f maybe: f instance? ] unit-test
+[ t ] [ f maybe{ POSTPONE: f } instance? ] unit-test
-PREDICATE: natural < maybe: integer
+PREDICATE: natural < maybe{ integer }
0 > ;
[ f ] [ -1 natural? ] unit-test
[ f ] [ 0 natural? ] unit-test
[ t ] [ 1 natural? ] unit-test
-[ t ] [ f maybe: maybe: integer instance? ] unit-test
-[ t ] [ 3 maybe: maybe: integer instance? ] unit-test
-[ f ] [ 3.03 maybe: maybe: integer instance? ] unit-test
+[ t ] [ f maybe{ maybe{ integer } } instance? ] unit-test
+[ t ] [ 3 maybe{ maybe{ integer } } instance? ] unit-test
+[ f ] [ 3.03 maybe{ maybe{ integer } } instance? ] unit-test
-INTERSECTION: only-f maybe: integer POSTPONE: f ;
+INTERSECTION: only-f maybe{ integer } POSTPONE: f ;
[ t ] [ f only-f instance? ] unit-test
[ f ] [ t only-f instance? ] unit-test
[ f ] [ 30 only-f instance? ] unit-test
-UNION: ?integer-float maybe: integer maybe: float ;
+UNION: ?integer-float maybe{ integer } maybe{ float } ;
[ t ] [ 30 ?integer-float instance? ] unit-test
[ t ] [ 30.0 ?integer-float instance? ] unit-test
TUPLE: foo ;
GENERIC: lol ( obj -- string )
-M: maybe: foo lol drop "lol" ;
+M: maybe{ foo } lol drop "lol" ;
[ "lol" ] [ foo new lol ] unit-test
[ "lol" ] [ f lol ] unit-test
TUPLE: foo2 a ;
GENERIC: lol2 ( obj -- string )
-M: maybe: foo lol2 drop "lol2" ;
+M: maybe{ foo } lol2 drop "lol2" ;
M: f lol2 drop "lol22" ;
[ "lol2" ] [ foo new lol2 ] unit-test
! See http://factorcode.org/license.txt for BSD license.
USING: accessors classes classes.algebra
classes.algebra.private classes.private classes.union.private
-effects kernel words ;
+effects kernel words sequences arrays ;
IN: classes.maybe
! The class slot has to be a union of a word and a classoid
-! for TUPLE: foo { a maybe: foo } ; and maybe: union{ integer float } to work.
-! In the first case, foo is not yet a tuple-class when maybe: is reached,
+! for TUPLE: foo { a maybe{ foo } } ; and maybe{ union{ integer float } }
+! to work.
+! In the first case, foo is not yet a tuple-class when maybe{ is reached,
! thus it's not a classoid yet. union{ is a classoid, so the second case works.
! words are not generally classoids, so classoid alone is insufficient.
TUPLE: maybe { class union{ word classoid } initial: object read-only } ;
class>> union-of-builtins? ;
M: maybe class-name
- class>> name>> ;
+ class>> class-name ;
M: maybe predicate-def
class>> predicate-def [ [ t ] if* ] curry ;
M: anonymous-union instance?
members>> [ instance? ] with any? ;
+M: anonymous-union class-name
+ members>> [ class-name ] map " " join ;
+
M: union-class normalize-class
members <anonymous-union> normalize-class ;
USING: accessors arrays assocs classes classes.private
classes.tuple classes.tuple.private continuations definitions
generic init kernel kernel.private math namespaces sequences
-sets source-files.errors vocabs words ;
+sets source-files.errors vocabs words classes.algebra ;
FROM: namespaces => set ;
IN: compiler.units
<PRIVATE
: add-once ( key assoc -- )
+ ! 2dup keys swap [ class= ] curry any? [ over redefine-error ] when conjoin ;
2dup key? [ over redefine-error ] when conjoin ;
: (remember-definition) ( definition loc assoc -- )
: with-methods ( class generic quot -- )
[ "methods" word-prop ] prepose [ update-generic ] 2bi ; inline
-GENERIC# method-word-name 1 ( class generic -- string )
-
-M: class method-word-name ( class generic -- string )
- [ name>> ] bi@ "=>" glue ;
-
-M: maybe method-word-name
- [ class>> name>> ] [ name>> ] bi* "=>" glue ;
+: method-word-name ( class generic -- string )
+ [ class-name ] [ name>> ] bi* "=>" glue ;
M: method parent-word
"method-generic" word-prop ;
] if*
] define-core-syntax
- "maybe:" [
- scan-class <maybe> suffix!
+ "maybe{" [
+ \ } [ <anonymous-union> <maybe> ] parse-literal
+ ] define-core-syntax
+
+ "not{" [
+ \ } [ <anonymous-union> <anonymous-complement> ] parse-literal
] define-core-syntax
"intersection{" [
VARIANT: ptx-storage-space
.reg
.sreg
- .const: { { bank maybe: integer } }
+ .const: { { bank maybe{ integer } } }
.global
.local
.param
.tex ;
TUPLE: ptx-target
- { arch maybe: ptx-arch }
+ { arch maybe{ ptx-arch } }
{ map_f64_to_f32? boolean }
- { texmode maybe: ptx-texmode } ;
+ { texmode maybe{ ptx-texmode } } ;
TUPLE: ptx
{ version string }
TUPLE: ptx-variable
{ extern? boolean }
{ visible? boolean }
- { align maybe: integer }
+ { align maybe{ integer } }
{ storage-space ptx-storage-space }
{ type ptx-type }
{ name string }
- { parameter maybe: integer }
+ { parameter maybe{ integer } }
{ dim dim }
- { initializer maybe: string } ;
+ { initializer maybe{ string } } ;
TUPLE: ptx-negation
{ var string } ;
integer float ptx-var ptx-negation ptx-vector ptx-indirect ;
TUPLE: ptx-instruction
- { label maybe: string }
- { predicate maybe: ptx-operand } ;
+ { label maybe{ string } }
+ { predicate maybe{ ptx-operand } } ;
TUPLE: ptx-entry
{ name string }
body ;
TUPLE: ptx-func < ptx-entry
- { return maybe: ptx-variable } ;
+ { return maybe{ ptx-variable } } ;
TUPLE: ptx-directive ;
.wide ;
TUPLE: ptx-mul-instruction < ptx-3op-instruction
- { mode maybe: ptx-mul-mode } ;
+ { mode maybe{ ptx-mul-mode } } ;
TUPLE: ptx-mad-instruction < ptx-4op-instruction
- { mode maybe: ptx-mul-mode }
+ { mode maybe{ ptx-mul-mode } }
{ sat? boolean } ;
VARIANT: ptx-prmt-mode
ROLE: ptx-float-ftz
{ ftz? boolean } ;
ROLE: ptx-float-env < ptx-float-ftz
- { round maybe: ptx-float-rounding-mode } ;
+ { round maybe{ ptx-float-rounding-mode } } ;
VARIANT: ptx-testp-op
.finite .infinite .number .notanumber .normal .subnormal ;
TUPLE: ptx-set-instruction < ptx-3op-instruction
{ cmp-op ptx-cmp-op }
- { bool-op maybe: ptx-op }
- { c maybe: ptx-operand }
+ { bool-op maybe{ ptx-op } }
+ { c maybe{ ptx-operand } }
{ ftz? boolean } ;
VARIANT: ptx-cache-op
TUPLE: ptx-ldst-instruction < ptx-2op-instruction
{ volatile? boolean }
- { storage-space maybe: ptx-storage-space }
- { cache-op maybe: ptx-cache-op } ;
+ { storage-space maybe{ ptx-storage-space } }
+ { cache-op maybe{ ptx-cache-op } } ;
VARIANT: ptx-cache-level
.L1 .L2 ;
TUPLE: addc < ptx-addsub-instruction ;
TUPLE: and < ptx-3op-instruction ;
TUPLE: atom < ptx-3op-instruction
- { storage-space maybe: ptx-storage-space }
+ { storage-space maybe{ ptx-storage-space } }
{ op ptx-op }
- { c maybe: ptx-operand } ;
+ { c maybe{ ptx-operand } } ;
TUPLE: bar.arrive < ptx-instruction
{ a ptx-operand }
{ b ptx-operand } ;
TUPLE: bar.red < ptx-2op-instruction
{ op ptx-op }
- { b maybe: ptx-operand }
+ { b maybe{ ptx-operand } }
{ c ptx-operand } ;
TUPLE: bar.sync < ptx-instruction
{ a ptx-operand }
- { b maybe: ptx-operand } ;
+ { b maybe{ ptx-operand } } ;
TUPLE: bfe < ptx-4op-instruction ;
TUPLE: bfi < ptx-5op-instruction ;
TUPLE: bfind < ptx-2op-instruction
TUPLE: brev < ptx-2op-instruction ;
TUPLE: brkpt < ptx-instruction ;
TUPLE: call < ptx-branch-instruction
- { return maybe: ptx-operand }
+ { return maybe{ ptx-operand } }
params ;
TUPLE: clz < ptx-2op-instruction ;
TUPLE: cnot < ptx-2op-instruction ;
TUPLE: copysign < ptx-3op-instruction ;
TUPLE: cos <{ ptx-2op-instruction ptx-float-env } ;
TUPLE: cvt < ptx-2op-instruction
- { round maybe: ptx-rounding-mode }
+ { round maybe{ ptx-rounding-mode } }
{ ftz? boolean }
{ sat? boolean }
{ dest-type ptx-type } ;
TUPLE: cvta < ptx-2op-instruction
{ to? boolean }
- { storage-space maybe: ptx-storage-space } ;
+ { storage-space maybe{ ptx-storage-space } } ;
TUPLE: div <{ ptx-3op-instruction ptx-float-env } ;
TUPLE: ex2 <{ ptx-2op-instruction ptx-float-env } ;
TUPLE: exit < ptx-instruction ;
TUPLE: popc < ptx-2op-instruction ;
TUPLE: prefetch < ptx-instruction
{ a ptx-operand }
- { storage-space maybe: ptx-storage-space }
+ { storage-space maybe{ ptx-storage-space } }
{ level ptx-cache-level } ;
TUPLE: prefetchu < ptx-instruction
{ a ptx-operand }
{ level ptx-cache-level } ;
TUPLE: prmt < ptx-4op-instruction
- { mode maybe: ptx-prmt-mode } ;
+ { mode maybe{ ptx-prmt-mode } } ;
TUPLE: rcp <{ ptx-2op-instruction ptx-float-env } ;
TUPLE: red < ptx-2op-instruction
- { storage-space maybe: ptx-storage-space }
+ { storage-space maybe{ ptx-storage-space } }
{ op ptx-op } ;
TUPLE: rem < ptx-3op-instruction ;
TUPLE: ret < ptx-instruction ;
TUPLE: set < ptx-set-instruction
{ dest-type ptx-type } ;
TUPLE: setp < ptx-set-instruction
- { |dest maybe: ptx-operand } ;
+ { |dest maybe{ ptx-operand } } ;
TUPLE: shl < ptx-3op-instruction ;
TUPLE: shr < ptx-3op-instruction ;
TUPLE: sin <{ ptx-2op-instruction ptx-float-env } ;
TUPLE: framebuffer < gpu-object
{ color-attachments array read-only }
- { depth-attachment maybe: framebuffer-attachment read-only initial: f }
- { stencil-attachment maybe: framebuffer-attachment read-only initial: f } ;
+ { depth-attachment maybe{ framebuffer-attachment } read-only initial: f }
+ { stencil-attachment maybe{ framebuffer-attachment } read-only initial: f } ;
UNION: any-framebuffer system-framebuffer framebuffer ;
VARIANT: color-attachment-ref
default-attachment
system-attachment: {
- { side maybe: framebuffer-attachment-side initial: f }
- { face maybe: framebuffer-attachment-face initial: back-face }
+ { side maybe{ framebuffer-attachment-side } initial: f }
+ { face maybe{ framebuffer-attachment-face } initial: back-face }
}
color-attachment: { { index integer } } ;
TUPLE: uniform
{ name string read-only initial: "" }
{ uniform-type class read-only initial: float-uniform }
- { dim maybe: integer read-only initial: f } ;
+ { dim maybe{ integer } read-only initial: f } ;
VARIANT: index-type
ubyte-indexes
C: <index-elements> index-elements
TUPLE: multi-index-elements
- { buffer maybe: buffer read-only }
+ { buffer maybe{ buffer } read-only }
{ ptrs read-only }
{ counts uint-array read-only }
{ index-type index-type read-only } ;
{ vertex-array vertex-array initial: T{ vertex-array-collection } read-only }
{ uniforms uniform-tuple read-only }
{ indexes vertex-indexes initial: T{ index-range } read-only }
- { instances maybe: integer initial: f read-only }
- { framebuffer maybe: any-framebuffer initial: system-framebuffer read-only }
+ { instances maybe{ integer } initial: f read-only }
+ { framebuffer maybe{ any-framebuffer } initial: system-framebuffer read-only }
{ output-attachments sequence initial: { default-attachment } read-only }
{ transform-feedback-output transform-feedback-output initial: f read-only } ;
ERROR: inaccurate-feedback-attribute-error attribute ;
TUPLE: vertex-attribute
- { name maybe: string read-only initial: f }
- { component-type component-type read-only initial: float-components }
- { dim integer read-only initial: 4 }
- { normalize? boolean read-only initial: f } ;
+ { name maybe{ string } read-only initial: f }
+ { component-type component-type read-only initial: float-components }
+ { dim integer read-only initial: 4 }
+ { normalize? boolean read-only initial: f } ;
MIXIN: vertex-format
{ line integer read-only }
{ shaders array read-only }
{ vertex-formats array read-only }
- { feedback-format maybe: vertex-format read-only }
+ { feedback-format maybe{ vertex-format } read-only }
{ geometry-shader-parameters array read-only }
{ instances hashtable read-only } ;
[ nip ] [ drop link-program ] if ;
TUPLE: feedback-format
- { vertex-format maybe: vertex-format read-only } ;
+ { vertex-format maybe{ vertex-format } read-only } ;
: validate-feedback-format ( sequence -- vertex-format/f )
dup length 1 <=
C: <viewport-state> viewport-state
TUPLE: scissor-state
- { rect maybe: rect read-only } ;
+ { rect maybe{ rect } read-only } ;
C: <scissor-state> scissor-state
TUPLE: multisample-state
{ multisample? boolean read-only }
{ sample-alpha-to-coverage? boolean read-only }
{ sample-alpha-to-one? boolean read-only }
- { sample-coverage maybe: float read-only }
+ { sample-coverage maybe{ float } read-only }
{ invert-sample-coverage? boolean read-only } ;
C: <multisample-state> multisample-state
C: <stencil-mode> stencil-mode
TUPLE: stencil-state
- { front-mode maybe: stencil-mode initial: f read-only }
- { back-mode maybe: stencil-mode initial: f read-only } ;
+ { front-mode maybe{ stencil-mode } initial: f read-only }
+ { back-mode maybe{ stencil-mode } initial: f read-only } ;
C: <stencil-state> stencil-state
TUPLE: depth-range-state
C: <depth-range-state> depth-range-state
TUPLE: depth-state
- { comparison maybe: comparison initial: f read-only } ;
+ { comparison maybe{ comparison } initial: f read-only } ;
C: <depth-state> depth-state
VARIANT: blend-equation
TUPLE: blend-state
{ constant-color sequence initial: f read-only }
- { rgb-mode maybe: blend-mode read-only }
- { alpha-mode maybe: blend-mode read-only } ;
+ { rgb-mode maybe{ blend-mode } read-only }
+ { alpha-mode maybe{ blend-mode } read-only } ;
C: <blend-state> blend-state
TUPLE: mask-state
TUPLE: triangle-cull-state
{ front-face triangle-face initial: face-ccw read-only }
- { cull maybe: triangle-cull initial: f read-only } ;
+ { cull maybe{ triangle-cull } initial: f read-only } ;
C: <triangle-cull-state> triangle-cull-state
TUPLE: triangle-state
origin-upper-left origin-lower-left ;
TUPLE: point-state
- { size maybe: float initial: 1.0 read-only }
+ { size maybe{ float } initial: 1.0 read-only }
{ sprite-origin point-sprite-origin initial: origin-upper-left read-only }
{ fade-threshold float initial: 1.0 read-only } ;
C: <point-state> point-state
TUPLE: texture-parameters
{ wrap wrap-set initial: { repeat-texcoord repeat-texcoord repeat-texcoord } }
{ min-filter texture-filter initial: filter-nearest }
- { min-mipmap-filter maybe: texture-filter initial: filter-linear }
+ { min-mipmap-filter maybe{ texture-filter } initial: filter-linear }
{ mag-filter texture-filter initial: filter-linear }
{ min-lod integer initial: -1000 }
{ max-lod integer initial: 1000 }