From 3cd3ea35db5be1318d958487c6a00519b98df296 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Lindqvist?= Date: Sat, 3 May 2014 16:29:35 +0200 Subject: [PATCH] Docs: generic.math and layouts --- core/generic/math/math-docs.factor | 13 +++++++++++-- core/layouts/layouts-docs.factor | 7 +++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/core/generic/math/math-docs.factor b/core/generic/math/math-docs.factor index 5953c5ad9b..f541db2486 100644 --- a/core/generic/math/math-docs.factor +++ b/core/generic/math/math-docs.factor @@ -2,6 +2,17 @@ USING: kernel generic help.markup help.syntax math classes sequences quotations generic.math.private ; IN: generic.math +HELP: math-class-max +{ $values { "class1" class } { "class2" class } } +{ $description "Evaluates which math class is the largest." } +{ $examples + { $example + "USING: generic.math math kernel prettyprint ;" + "integer float math-class-max ." + "float" + } +} ; + HELP: math-upgrade { $values { "class1" class } { "class2" class } { "quot" { $quotation "( n n -- n n )" } } } { $description "Outputs a quotation for upgrading numberical types. It takes two numbers on the stack, an instance of " { $snippet "class1" } ", and an instance of " { $snippet "class2" } ", and converts the one with the lower priority to the higher priority type." } @@ -39,5 +50,3 @@ $nl HELP: math-generic { $class-description "The class of generic words using " { $link math-combination } "." } ; - - diff --git a/core/layouts/layouts-docs.factor b/core/layouts/layouts-docs.factor index 2897f48e34..d330f52519 100644 --- a/core/layouts/layouts-docs.factor +++ b/core/layouts/layouts-docs.factor @@ -39,11 +39,11 @@ HELP: bootstrap-first-bignum { $description "Outputs the value for the target architecture when bootstrapping." } ; HELP: bootstrap-most-positive-fixnum -{ $values { "n" "largest positive integer representable by a fixnum" } } +{ $values { "n" "largest positive integer representable by a fixnum" } } { $description "Outputs the value for the target architecture when bootstrapping." } ; HELP: bootstrap-most-negative-fixnum -{ $values { "n" "smallest negative integer representable by a fixnum" } } +{ $values { "n" "smallest negative integer representable by a fixnum" } } { $description "Outputs the value for the target architecture when bootstrapping." } ; HELP: cell @@ -70,6 +70,9 @@ HELP: bootstrap-cell-bits { $values { "n" integer } } { $description "Outputs the number of bits in one cell in the target image (if bootstrapping) or the current CPU architecture (otherwise)." } ; +HELP: immediate +{ $class-description "Union class of all values that the Factor VM can store immediately, all others are stored as references (pointer) to them." } ; + ARTICLE: "layouts-types" "Type numbers" "Corresponding to every built-in class is a built-in type number. An object can be asked for its built-in type number:" { $subsections tag }