core: back to ; optional now.
parent
77b6f610d9
commit
c0223d28f0
|
@ -9,7 +9,7 @@ ERROR: not-in-a-method-error ;
|
||||||
: scan-new-generic ( -- word ) scan-new dup reset-word ;
|
: scan-new-generic ( -- word ) scan-new dup reset-word ;
|
||||||
|
|
||||||
: (GENERIC:) ( quot -- )
|
: (GENERIC:) ( quot -- )
|
||||||
[ scan-new-generic ] dip call scan-effect ";" expect define-generic ; inline
|
[ scan-new-generic ] dip call scan-effect define-generic ; inline
|
||||||
|
|
||||||
: create-method-in ( class generic -- method )
|
: create-method-in ( class generic -- method )
|
||||||
create-method dup set-last-word dup save-location ;
|
create-method dup set-last-word dup save-location ;
|
||||||
|
|
|
@ -150,7 +150,7 @@ IN: bootstrap.syntax
|
||||||
|
|
||||||
"PRIMITIVE:" [
|
"PRIMITIVE:" [
|
||||||
current-vocab name>>
|
current-vocab name>>
|
||||||
scan-word scan-effect ";" expect ensure-primitive
|
scan-word scan-effect ensure-primitive
|
||||||
] define-core-syntax
|
] define-core-syntax
|
||||||
|
|
||||||
"CS{" [
|
"CS{" [
|
||||||
|
@ -171,7 +171,7 @@ IN: bootstrap.syntax
|
||||||
|
|
||||||
"QUALIFIED:" [ scan-token dup add-qualified ] define-core-syntax
|
"QUALIFIED:" [ scan-token dup add-qualified ] define-core-syntax
|
||||||
|
|
||||||
"QUALIFIED-WITH:" [ scan-token scan-token ";" expect add-qualified ] define-core-syntax
|
"QUALIFIED-WITH:" [ scan-token scan-token add-qualified ] define-core-syntax
|
||||||
|
|
||||||
"FROM:" [
|
"FROM:" [
|
||||||
scan-token "=>" expect ";" parse-tokens add-words-from
|
scan-token "=>" expect ";" parse-tokens add-words-from
|
||||||
|
@ -265,11 +265,11 @@ IN: bootstrap.syntax
|
||||||
|
|
||||||
|
|
||||||
"ALIAS:" [
|
"ALIAS:" [
|
||||||
scan-new-escaped scan-escaped-word ";" expect define-alias
|
scan-new-escaped scan-escaped-word define-alias
|
||||||
] define-core-syntax
|
] define-core-syntax
|
||||||
|
|
||||||
"CONSTANT:" [
|
"CONSTANT:" [
|
||||||
scan-new-word scan-object ";" expect define-constant
|
scan-new-word scan-object define-constant
|
||||||
] define-core-syntax
|
] define-core-syntax
|
||||||
|
|
||||||
":" [
|
":" [
|
||||||
|
@ -310,7 +310,7 @@ IN: bootstrap.syntax
|
||||||
|
|
||||||
"INSTANCE:" [
|
"INSTANCE:" [
|
||||||
location [
|
location [
|
||||||
scan-word scan-word ";" expect 2dup add-mixin-instance
|
scan-word scan-word 2dup add-mixin-instance
|
||||||
<mixin-instance>
|
<mixin-instance>
|
||||||
] dip remember-definition
|
] dip remember-definition
|
||||||
] define-core-syntax
|
] define-core-syntax
|
||||||
|
@ -342,7 +342,7 @@ IN: bootstrap.syntax
|
||||||
] define-core-syntax
|
] define-core-syntax
|
||||||
|
|
||||||
"C:" [
|
"C:" [
|
||||||
scan-new-word scan-word ";" expect define-boa-word
|
scan-new-word scan-word define-boa-word
|
||||||
] define-core-syntax
|
] define-core-syntax
|
||||||
|
|
||||||
"ERROR:" [
|
"ERROR:" [
|
||||||
|
|
|
@ -41,9 +41,9 @@ TUPLE: aux-buffers < pixel-format-attribute ;
|
||||||
TUPLE: sample-buffers < pixel-format-attribute ;
|
TUPLE: sample-buffers < pixel-format-attribute ;
|
||||||
TUPLE: samples < pixel-format-attribute ;
|
TUPLE: samples < pixel-format-attribute ;
|
||||||
|
|
||||||
HOOK: (make-pixel-format) ui-backend ( world attributes -- pixel-format-handle ) ;
|
HOOK: (make-pixel-format) ui-backend ( world attributes -- pixel-format-handle )
|
||||||
HOOK: (free-pixel-format) ui-backend ( pixel-format -- ) ;
|
HOOK: (free-pixel-format) ui-backend ( pixel-format -- )
|
||||||
HOOK: (pixel-format-attribute) ui-backend ( pixel-format attribute-name -- value ) ;
|
HOOK: (pixel-format-attribute) ui-backend ( pixel-format attribute-name -- value )
|
||||||
|
|
||||||
ERROR: invalid-pixel-format-attributes world attributes ;
|
ERROR: invalid-pixel-format-attributes world attributes ;
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ FUNCTOR< define-pixel-format-attribute-table ( NAME PERM TABLE -- )
|
||||||
|
|
||||||
WHERE
|
WHERE
|
||||||
|
|
||||||
GENERIC: >PFA ( attribute -- pfas ) ;
|
GENERIC: >PFA ( attribute -- pfas )
|
||||||
|
|
||||||
M: object >PFA
|
M: object >PFA
|
||||||
drop { } ;
|
drop { } ;
|
||||||
|
@ -84,10 +84,10 @@ M: pixel-format-attribute >PFA
|
||||||
FUNCTOR>
|
FUNCTOR>
|
||||||
|
|
||||||
SYNTAX: \ PIXEL-FORMAT-ATTRIBUTE-TABLE:
|
SYNTAX: \ PIXEL-FORMAT-ATTRIBUTE-TABLE:
|
||||||
scan-token scan-object scan-object ";" expect define-pixel-format-attribute-table ;
|
scan-token scan-object scan-object define-pixel-format-attribute-table ;
|
||||||
|
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
GENERIC: world-pixel-format-attributes ( 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 -- )
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
USING: classes.struct classes.tuple functors tools.test math
|
USING: classes.struct classes.tuple functors tools.test math
|
||||||
words kernel parser io.streams.string generic ;
|
words kernel parser io.streams.string generic ;
|
||||||
QUALIFIED-WITH: alien.c-types c ;
|
QUALIFIED-WITH: alien.c-types c
|
||||||
IN: functors.tests
|
IN: functors.tests
|
||||||
|
|
||||||
COMPILE<
|
COMPILE<
|
||||||
|
@ -14,7 +14,7 @@ WHERE
|
||||||
|
|
||||||
TUPLE: B { value T } ;
|
TUPLE: B { value T } ;
|
||||||
|
|
||||||
C: <B> B ;
|
C: <B> B
|
||||||
|
|
||||||
FUNCTOR>
|
FUNCTOR>
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ W DEFINES ${W}
|
||||||
|
|
||||||
WHERE
|
WHERE
|
||||||
|
|
||||||
GENERIC: W ( a -- b ) ;
|
GENERIC: W ( a -- b )
|
||||||
M: object W ;
|
M: object W ;
|
||||||
M: integer W 1 + ;
|
M: integer W 1 + ;
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@ WHERE
|
||||||
|
|
||||||
TUPLE: W-tuple ;
|
TUPLE: W-tuple ;
|
||||||
: W-word ( -- ) ;
|
: W-word ( -- ) ;
|
||||||
GENERIC: W-generic ( a -- b ) ;
|
GENERIC: W-generic ( a -- b )
|
||||||
M: W-tuple W-generic ;
|
M: W-tuple W-generic ;
|
||||||
SYMBOL: W-symbol
|
SYMBOL: W-symbol
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ TUPLE: fake-call-next-method ;
|
||||||
|
|
||||||
TUPLE: fake-quotation seq ;
|
TUPLE: fake-quotation seq ;
|
||||||
|
|
||||||
GENERIC: >fake-quotations ( quot -- fake ) ;
|
GENERIC: >fake-quotations ( quot -- fake )
|
||||||
|
|
||||||
M: callable >fake-quotations
|
M: callable >fake-quotations
|
||||||
>array >fake-quotations fake-quotation boa ;
|
>array >fake-quotations fake-quotation boa ;
|
||||||
|
@ -26,7 +26,7 @@ M: array >fake-quotations [ >fake-quotations ] { } map-as ;
|
||||||
|
|
||||||
M: object >fake-quotations ;
|
M: object >fake-quotations ;
|
||||||
|
|
||||||
GENERIC: (fake-quotations>) ( fake -- ) ;
|
GENERIC: (fake-quotations>) ( fake -- )
|
||||||
|
|
||||||
: fake-quotations> ( fake -- quot )
|
: fake-quotations> ( fake -- quot )
|
||||||
[ (fake-quotations>) ] [ ] make ;
|
[ (fake-quotations>) ] [ ] make ;
|
||||||
|
@ -107,13 +107,11 @@ FUNCTOR-SYNTAX: \ SYNTAX:
|
||||||
FUNCTOR-SYNTAX: \ INSTANCE:
|
FUNCTOR-SYNTAX: \ INSTANCE:
|
||||||
scan-param suffix!
|
scan-param suffix!
|
||||||
scan-param suffix!
|
scan-param suffix!
|
||||||
";" expect
|
|
||||||
\ add-mixin-instance suffix! ;
|
\ add-mixin-instance suffix! ;
|
||||||
|
|
||||||
FUNCTOR-SYNTAX: \ GENERIC:
|
FUNCTOR-SYNTAX: \ GENERIC:
|
||||||
scan-param suffix!
|
scan-param suffix!
|
||||||
scan-effect suffix!
|
scan-effect suffix!
|
||||||
";" expect
|
|
||||||
\ define-simple-generic* suffix! ;
|
\ define-simple-generic* suffix! ;
|
||||||
|
|
||||||
FUNCTOR-SYNTAX: \ MACRO:
|
FUNCTOR-SYNTAX: \ MACRO:
|
||||||
|
|
Loading…
Reference in New Issue