object
Factor handbook » The language » Objects » Classes

Prev:Class predicate words
Next:null


Vocabulary
kernel

Class description
The class of all objects. If a generic word defines a method specializing on this class, the method is used as a fallback, if no other applicable method is found. For instance:
GENERIC: enclose ( number -- array ) M: number enclose 1array ; M: object enclose ;


Definition


Methods



























































































































































































M: object (set-post-data-headers)
drop "chunked" "transfer-encoding" pick set-at ;



























M:: object <menu-item> ( target hook command -- menu-item )
command command-name [
hook call target command command-button-quot call
hide-glass
] <menu-button> ;









M: object <test-secure-config>*
drop
<secure-config> "vocab:openssl/test-1.2/server.pem"
>>key-file "vocab:openssl/test-1.2/dh2048.pem" >>dh-file
"password" >>password ;



















































M: object >post-data
"application/octet-stream" <post-data> swap >>data ;






























M:: object >uniform-matrix ( sequence cols rows -- c-array )
sequence flip cols head-slice
[ rows head-slice float >c-array ] { } map-as concat ;
inline




















































































M:: object answer ( class from to -- new-class )
class from = to class ? ;




































































































































































































































































































































































































































M: object g drop "object" ;










































M: object holidays
(holidays)
[ [ clone ] dip ( timestamp -- timestamp ) execute-effect ]
with map ;




























































































































































































































































M:: object push-value ( stats x -- stats )
stats dup n>> zero?
[ x >>min x >>max ]
[ [ x min ] change-min [ x max ] change-max ] if
[ 1 + dup ] change-n swap :> n [ x + ] change-sum
x over mom1>> - :> delta delta n /f
:> delta_n delta_n sq :> delta_n2 delta delta_n * n 1 - *
:> term1 [
term1 delta_n2 * n sq 3 n * - 3 + * 6 delta_n2 *
stats mom2>> * + 4 delta_n * stats mom3>> * - +
] change-mom4
[ term1 delta_n * n 2 - * 3 delta_n * stats mom2>> * - + ]
change-mom3 [ term1 + ] change-mom2
[ delta_n + ] change-mom1 ;













































M: object resolve-localhost
ipv6-supported?
{ T{ ipv4 { host "0.0.0.0" } } T{ ipv6 { host "::" } } }
{ T{ ipv4 { host "0.0.0.0" } } } ? ;




















































































M:: object selector-do: ( quot receiver -- result )
receiver [ quot ( elt -- result ) call-effect drop ] each
nil ;













































M:: object selector-to:do: ( to quot from -- result )
from to [a..b]
[ quot ( i -- result ) call-effect drop ] each nil ;






M: object selector-value: ( input -- result ) call-effect ;



M: object selector-value:value:
( input input -- result ) call-effect ;



M: object selector-value:value:value:
( input input input -- result ) call-effect ;



M: object selector-value:value:value:value:
( input input input input -- result ) call-effect ;