]> gitweb.factorcode.org Git - factor.git/commitdiff
alien.complex: fix docs
authorSlava Pestov <slava@factorcode.org>
Tue, 11 Oct 2011 04:58:49 +0000 (21:58 -0700)
committerSlava Pestov <slava@factorcode.org>
Tue, 11 Oct 2011 05:12:50 +0000 (22:12 -0700)
basis/alien/c-types/c-types-docs.factor
basis/alien/complex/complex-docs.factor [new file with mode: 0644]

index 3d3dc1797860d16b850e7017e0ed8b486dbbd659..bda213db197292b814a88a431e126a5174547fe0 100644 (file)
@@ -1,6 +1,6 @@
-USING: alien alien.complex help.syntax help.markup libc kernel.private
-byte-arrays strings hashtables alien.syntax alien.strings sequences
-io.encodings.string debugger destructors vocabs.loader
+USING: alien help.syntax help.markup libc kernel.private
+byte-arrays strings hashtables alien.syntax alien.strings
+sequences io.encodings.string debugger destructors vocabs.loader
 classes.struct math kernel ;
 QUALIFIED: math
 QUALIFIED: sequences
@@ -76,10 +76,6 @@ HELP: float
 { $description "This C type represents a single-precision IEEE 754 floating-point type. Input values will be converted to Factor " { $link math:float } "s and demoted to single-precision; output values will be returned as Factor " { $link math:float } "s." } ;
 HELP: double
 { $description "This C type represents a double-precision IEEE 754 floating-point type. Input values will be converted to Factor " { $link math:float } "s; output values will be returned as Factor " { $link math:float } "s." } ;
-HELP: complex-float
-{ $description "This C type represents a single-precision IEEE 754 floating-point complex type. Input values will be converted from Factor " { $link math:complex } " objects into a single-precision complex float type; output values will be returned as Factor " { $link math:complex } " objects." } ;
-HELP: complex-double
-{ $description "This C type represents a double-precision IEEE 754 floating-point complex type. Input values will be converted from Factor " { $link math:complex } " objects into a double-precision complex float type; output values will be returned as Factor " { $link math:complex } " objects." } ;
 
 HELP: pointer:
 { $syntax "pointer: c-type" }
@@ -125,11 +121,8 @@ ARTICLE: "c-types.primitives" "Primitive C types"
     { { $link float } { "single-precision float (not the same as Factor's " { $link math:float } " class!)" } }
     { { $link double } { "double-precision float (the same format as Factor's " { $link math:float } " objects)" } }
 }
-"The following C99 complex number types are defined in the " { $vocab-link "alien.complex" } " vocabulary:"
-{ $table
-    { { $link complex-float } { "C99 or Fortran " { $snippet "complex float" } " type, converted to and from Factor " { $link math:complex } " values" } }
-    { { $link complex-double } { "C99 or Fortran " { $snippet "complex double" } " type, converted to and from Factor " { $link math:complex } " values" } }
-}
+"C99 complex number types are defined in the " { $vocab-link "alien.complex" } " vocabulary."
+$nl
 "When making alien calls, Factor numbers are converted to and from the above types in a canonical way. Converting a Factor number to a C value may result in a loss of precision." ;
 
 ARTICLE: "c-types.pointers" "Pointer and array types"
diff --git a/basis/alien/complex/complex-docs.factor b/basis/alien/complex/complex-docs.factor
new file mode 100644 (file)
index 0000000..c530b1b
--- /dev/null
@@ -0,0 +1,14 @@
+USING: help.markup help.syntax math ;
+IN: alien.complex
+
+HELP: complex-float
+{ $description "This C type represents a single-precision IEEE 754 floating-point complex type. Input values will be converted from Factor " { $link complex } " objects into a single-precision complex float type; output values will be returned as Factor " { $link complex } " objects." } ;
+HELP: complex-double
+{ $description "This C type represents a double-precision IEEE 754 floating-point complex type. Input values will be converted from Factor " { $link complex } " objects into a double-precision complex float type; output values will be returned as Factor " { $link complex } " objects." } ;
+
+ARTICLE: "alien.complex" "C99 complex number types"
+"The following C99 complex number types are defined in the " { $vocab-link "alien.complex" } " vocabulary:"
+{ $table
+    { { $link complex-float } { "C99 or Fortran " { $snippet "complex float" } " type, converted to and from Factor " { $link complex } " values" } }
+    { { $link complex-double } { "C99 or Fortran " { $snippet "complex double" } " type, converted to and from Factor " { $link complex } " values" } }
+} ;