: default-CreateProcess-args ( -- obj )
CreateProcess-args new
STARTUPINFO <struct>
- dup class heap-size >>cb
+ dup class-of heap-size >>cb
>>lpStartupInfo
PROCESS_INFORMATION <struct> >>lpProcessInformation
TRUE >>bInheritHandles
M: array array-base-type first ;
: (field-spec-of) ( field struct -- field-spec )
- c-type fields>> [ name>> = ] with find nip ;
+ lookup-c-type fields>> [ name>> = ] with find nip ;
: (offsetof) ( field struct -- offset )
[ (field-spec-of) offset>> ] [ drop 0 ] if* ;
: (sizeof) ( field struct -- size )
"Here is an array containing the " { $link f } " class:"
{ $example "{ POSTPONE: f } ." "{ POSTPONE: f }" }
"The " { $link f } " object is an instance of the " { $link f } " class:"
-{ $example "USE: classes" "f class ." "POSTPONE: f" }
+{ $example "USE: classes" "f class-of ." "POSTPONE: f" }
"The " { $link f } " class is an instance of " { $link word } ":"
-{ $example "USE: classes" "\\ f class ." "word" }
+{ $example "USE: classes" "\\ f class-of ." "word" }
"On the other hand, " { $link t } " is just a word, and there is no class which it is a unique instance of."
{ $example "t \\ t eq? ." "t" }
"Many words which search collections confuse the case of no element being present with an element being found equal to " { $link f } ". If this distinction is important, there is usually an alternative word which can be used; for example, compare " { $link at } " with " { $link at* } "." ;
ARTICLE: "integers" "Integers"
{ $subsections integer }
"Integers come in two varieties -- fixnums and bignums. Fixnums fit in a machine word and are faster to manipulate; if the result of a fixnum operation is too large to fit in a fixnum, the result is upgraded to a bignum. Here is an example where two fixnums are multiplied yielding a bignum:"
-{ $example "USE: classes" "67108864 class ." "fixnum" }
-{ $example "USE: classes" "128 class ." "fixnum" }
+{ $example "USE: classes" "67108864 class-of ." "fixnum" }
+{ $example "USE: classes" "128 class-of ." "fixnum" }
{ $example "134217728 128 * ." "17179869184" }
-{ $example "USE: classes" "1 128 shift class ." "bignum" }
+{ $example "USE: classes" "1 128 shift class-of ." "bignum" }
"Integers can be entered using a different base; see " { $link "syntax-numbers" } "."
$nl
"Integers can be tested for, and real numbers can be converted to integers:"
"Math operations obey certain numerical upgrade rules. If one of the inputs is a bignum and the other is a fixnum, the latter is first coerced to a bignum; if one of the inputs is a float, the other is coerced to a float."
$nl
"Two examples where you should note the types of the inputs and outputs:"
-{ $example "USE: classes" "3 >fixnum 6 >bignum * class ." "bignum" }
+{ $example "USE: classes" "3 >fixnum 6 >bignum * class-of ." "bignum" }
{ $example "1/2 2.0 + ." "2.5" }
"The following usual operations are supported by all numbers."
{ $subsections
{ $example
"USING: accessors classes graphviz kernel prettyprint strings ;"
"1 { 2 3 4 } <edge>"
- "[ tail>> class . ] [ head>> class . ] bi"
+ "[ tail>> class-of . ] [ head>> class-of . ] bi"
"string\nsubgraph"
}
$nl
" 1 <node> add"
" 2 <node> add"
" 1 2 <edge> add"
- "statements>> [ class . ] each"
+ "statements>> [ class-of . ] each"
"node\nnode\nedge"
}
}