From 2b6f9f31ff2f523c34cafb916db57390552d2d9f Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Fri, 30 Jan 2009 16:17:50 -0600 Subject: [PATCH 1/6] fix help-lint docs for db --- basis/db/db-docs.factor | 2 +- basis/db/types/types-docs.factor | 93 ++++---------------------------- 2 files changed, 10 insertions(+), 85 deletions(-) diff --git a/basis/db/db-docs.factor b/basis/db/db-docs.factor index 08544b3367..c392ec6b85 100644 --- a/basis/db/db-docs.factor +++ b/basis/db/db-docs.factor @@ -173,7 +173,7 @@ HELP: with-db HELP: with-transaction { $values { "quot" quotation } } -{ $description "" } ; +{ $description "Calls the quotation inside a database transaction and commits the result to the database after the quotation finishes. If the quotation throws an error, the transaction is aborted." } ; ARTICLE: "db" "Database library" "Accessing a database:" diff --git a/basis/db/types/types-docs.factor b/basis/db/types/types-docs.factor index b8ccbd976f..4d3be1d592 100644 --- a/basis/db/types/types-docs.factor +++ b/basis/db/types/types-docs.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2008 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. USING: classes hashtables help.markup help.syntax io.streams.string -kernel sequences strings math ; +kernel sequences strings math db.tuples db.tuples.private ; IN: db.types HELP: +db-assigned-id+ @@ -27,15 +27,11 @@ HELP: +user-assigned-id+ HELP: { $values { "slot-name" object } { "key" object } { "generator-singleton" object } { "type" object } { "generator-bind" generator-bind } } -{ $description "" } ; +{ $description "An internal constructor for creating objects containing parameters used for binding generated values to a tuple query." } ; HELP: { $values { "key" object } { "type" object } { "value" object } { "literal-bind" literal-bind } } -{ $description "" } ; - -HELP: -{ $values { "value" object } { "low-level-binding" low-level-binding } } -{ $description "" } ; +{ $description "An internal constructor for creating objects containing parameters used for binding literal values to a tuple query." } ; HELP: BIG-INTEGER { $description "A 64-bit integer. Whether this number is signed or unsigned depends on the database backend." } ; @@ -100,18 +96,12 @@ HELP: user-assigned-id-spec? HELP: bind# { $values { "spec" "a sql spec" } { "obj" object } } -{ $description "" } ; +{ $description "A generic word that lets a database construct a literal binding." } ; HELP: bind% { $values { "spec" "a sql spec" } } -{ $description "" } ; - -HELP: compound -{ $values - { "string" string } { "obj" object } - { "hash" hashtable } } -{ $description "" } ; +{ $description "A generic word that lets a database output a binding." } ; HELP: db-assigned-id-spec? { $values @@ -126,45 +116,12 @@ HELP: find-primary-key { $description "Returns the rows from the sql-specs array that are part of the primary key. Composite primary keys are supported, so this word must return a sequence." } { $notes "This is a low-level word." } ; -HELP: generator-bind -{ $description "" } ; - HELP: get-slot-named { $values { "name" "a slot name" } { "tuple" tuple } { "value" "the value stored in the slot" } } { $description "Returns the value stored in a tuple slot, where the tuple slot is a string." } ; -HELP: literal-bind -{ $description "" } ; - -HELP: lookup-create-type -{ $values - { "obj" object } - { "string" string } } -{ $description "" } ; - -HELP: lookup-modifier -{ $values - { "obj" object } - { "string" string } } -{ $description "" } ; - -HELP: lookup-type -{ $values - { "obj" object } - { "string" string } } -{ $description "" } ; - -HELP: low-level-binding -{ $description "" } ; - -HELP: modifiers -{ $values - { "spec" "a sql spec" } - { "string" string } } -{ $description "" } ; - HELP: no-sql-type { $values { "type" "a sql type" } } @@ -173,7 +130,7 @@ HELP: no-sql-type HELP: normalize-spec { $values { "spec" "a sql spec" } } -{ $description "" } ; +{ $description "Normalizes a sql spec." } ; HELP: offset-of-slot { $values @@ -181,52 +138,20 @@ HELP: offset-of-slot { "n" integer } } { $description "Returns the offset of a tuple slot accessed by name." } ; -HELP: persistent-table -{ $values - - { "hash" hashtable } } -{ $description "" } ; - HELP: primary-key? { $values { "spec" "a sql spec" } { "?" "a boolean" } } -{ $description "" } ; +{ $description "Returns true if a sql spec is a primary key." } ; HELP: random-id-generator -{ $description "" } ; +{ $description "Used to tell " { $link eval-generator } " to generate a random number for use as a key." } ; HELP: relation? { $values { "spec" "a sql spec" } { "?" "a boolean" } } -{ $description "" } ; - -HELP: remove-db-assigned-id -{ $values - { "specs" "a sequence of sql specs" } - { "obj" object } } -{ $description "" } ; - -HELP: remove-id -{ $values - { "specs" "a sequence of sql specs" } - { "obj" object } } -{ $description "" } ; - -HELP: set-slot-named -{ $values - { "value" object } { "name" string } { "obj" object } } -{ $description "" } ; - -HELP: spec>tuple -{ $values - { "class" class } { "spec" "a sql spec" } - { "tuple" tuple } } -{ $description "" } ; - -HELP: sql-spec -{ $description "" } ; +{ $description "Returns true if a sql spec is a relation." } ; HELP: unknown-modifier { $values { "modifier" string } } From a60e11b89e328b57b5121f6cc0fd6c0a9a9ae9c8 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Fri, 30 Jan 2009 16:45:30 -0600 Subject: [PATCH 2/6] add RTLD_GLOBAL to dlopen flags. load atlas before cblas on freebsd --- basis/math/blas/cblas/cblas.factor | 12 +++++++++--- vm/os-unix.c | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/basis/math/blas/cblas/cblas.factor b/basis/math/blas/cblas/cblas.factor index 4c0a88f929..3914c5b2ec 100644 --- a/basis/math/blas/cblas/cblas.factor +++ b/basis/math/blas/cblas/cblas.factor @@ -1,13 +1,19 @@ USING: alien alien.c-types alien.syntax kernel system combinators ; IN: math.blas.cblas -<< "cblas" { +<< +: load-atlas ( -- ) + "atlas" "libatlas.so" "cdecl" add-library + "atlas" load-library drop ; + +"cblas" { { [ os macosx? ] [ "libblas.dylib" "cdecl" add-library ] } { [ os windows? ] [ "blas.dll" "cdecl" add-library ] } { [ os openbsd? ] [ "libcblas.so" "cdecl" add-library ] } - { [ os freebsd? ] [ "libcblas.so" "cdecl" add-library ] } + { [ os freebsd? ] [ "libcblas.so" "cdecl" add-library load-atlas ] } [ "libblas.so" "cdecl" add-library ] -} cond >> +} cond +>> LIBRARY: cblas diff --git a/vm/os-unix.c b/vm/os-unix.c index 97c29d8c6e..b49f7637af 100755 --- a/vm/os-unix.c +++ b/vm/os-unix.c @@ -36,7 +36,7 @@ void init_ffi(void) void ffi_dlopen(F_DLL *dll) { - dll->dll = dlopen(alien_offset(dll->path), RTLD_LAZY); + dll->dll = dlopen(alien_offset(dll->path), RTLD_LAZY|RTLD_GLOBAL); } void *ffi_dlsym(F_DLL *dll, F_SYMBOL *symbol) From 7a4b03821b995332cb2a023557f697e9efd36de0 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Fri, 30 Jan 2009 16:52:03 -0600 Subject: [PATCH 3/6] Fix furnace help lint warning --- basis/furnace/utilities/utilities-docs.factor | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/basis/furnace/utilities/utilities-docs.factor b/basis/furnace/utilities/utilities-docs.factor index 1402e9c0ca..d2291786df 100644 --- a/basis/furnace/utilities/utilities-docs.factor +++ b/basis/furnace/utilities/utilities-docs.factor @@ -57,7 +57,7 @@ HELP: modify-redirect-query HELP: nested-responders { $values { "seq" "a sequence of responders" } } -{ $description "" } ; +{ $description "Outputs a sequence of responders which participated in the processing of the current request, with the main responder first and the innermost responder last." } ; HELP: referrer { $values { "referrer/f" { $maybe string } } } @@ -69,11 +69,11 @@ HELP: request-params HELP: resolve-base-path { $values { "string" string } { "string'" string } } -{ $description "" } ; +{ $description "Resolves a responder-relative URL." } ; HELP: resolve-template-path { $values { "pair" "a pair with shape " { $snippet "{ class string }" } } { "path" "a pathname string" } } -{ $description "" } ; +{ $description "Resolves a responder-relative template path." } ; HELP: same-host? { $values { "url" url } { "?" "a boolean" } } @@ -85,7 +85,7 @@ HELP: user-agent HELP: vocab-path { $values { "vocab" "a vocabulary specifier" } { "path" "a pathname string" } } -{ $description "" } ; +{ $description "Outputs the full pathname of the vocabulary's source directory." } ; HELP: exit-with { $values { "value" object } } From 658743bb00c2a7e5357a4db2e3e7228f107a6d43 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Fri, 30 Jan 2009 17:13:12 -0600 Subject: [PATCH 4/6] add missing copyright to svg.factor --- extra/svg/svg.factor | 1 + 1 file changed, 1 insertion(+) diff --git a/extra/svg/svg.factor b/extra/svg/svg.factor index b5c5e96e90..6df7314653 100644 --- a/extra/svg/svg.factor +++ b/extra/svg/svg.factor @@ -1,3 +1,4 @@ +! (c)2009 Joe Groff, see BSD license USING: accessors arrays assocs fry kernel math math.affine-transforms math.constants math.functions math.parser math.vectors memoize peg.ebnf sequences sequences.squish splitting strings xml.data xml.utilities ; From 8b68e80254e35c3b5ef862b0aac9bcb255e8d2db Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Fri, 30 Jan 2009 17:13:40 -0600 Subject: [PATCH 5/6] load libblas before libcblas on openbsd --- basis/math/blas/cblas/cblas.factor | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/basis/math/blas/cblas/cblas.factor b/basis/math/blas/cblas/cblas.factor index 3914c5b2ec..54616d42de 100644 --- a/basis/math/blas/cblas/cblas.factor +++ b/basis/math/blas/cblas/cblas.factor @@ -3,13 +3,14 @@ IN: math.blas.cblas << : load-atlas ( -- ) - "atlas" "libatlas.so" "cdecl" add-library - "atlas" load-library drop ; + "atlas" "libatlas.so" "cdecl" add-library ; +: load-blas ( -- ) + "blas" "libblas.so" "cdecl" add-library ; "cblas" { { [ os macosx? ] [ "libblas.dylib" "cdecl" add-library ] } { [ os windows? ] [ "blas.dll" "cdecl" add-library ] } - { [ os openbsd? ] [ "libcblas.so" "cdecl" add-library ] } + { [ os openbsd? ] [ "libcblas.so" "cdecl" add-library load-blas ] } { [ os freebsd? ] [ "libcblas.so" "cdecl" add-library load-atlas ] } [ "libblas.so" "cdecl" add-library ] } cond From f1182ef800c429a68ff9afc370fabff3e161189d Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Fri, 30 Jan 2009 17:28:06 -0600 Subject: [PATCH 6/6] use CONSTANT: for cblas constants --- basis/math/blas/cblas/cblas.factor | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/basis/math/blas/cblas/cblas.factor b/basis/math/blas/cblas/cblas.factor index 54616d42de..11552d67bb 100644 --- a/basis/math/blas/cblas/cblas.factor +++ b/basis/math/blas/cblas/cblas.factor @@ -19,25 +19,25 @@ IN: math.blas.cblas LIBRARY: cblas TYPEDEF: int CBLAS_ORDER -: CblasRowMajor 101 ; inline -: CblasColMajor 102 ; inline +CONSTANT: CblasRowMajor 101 +CONSTANT: CblasColMajor 102 TYPEDEF: int CBLAS_TRANSPOSE -: CblasNoTrans 111 ; inline -: CblasTrans 112 ; inline -: CblasConjTrans 113 ; inline +CONSTANT: CblasNoTrans 111 +CONSTANT: CblasTrans 112 +CONSTANT: CblasConjTrans 113 TYPEDEF: int CBLAS_UPLO -: CblasUpper 121 ; inline -: CblasLower 122 ; inline +CONSTANT: CblasUpper 121 +CONSTANT: CblasLower 122 TYPEDEF: int CBLAS_DIAG -: CblasNonUnit 131 ; inline -: CblasUnit 132 ; inline +CONSTANT: CblasNonUnit 131 +CONSTANT: CblasUnit 132 TYPEDEF: int CBLAS_SIDE -: CblasLeft 141 ; inline -: CblasRight 142 ; inline +CONSTANT: CblasLeft 141 +CONSTANT: CblasRight 142 TYPEDEF: int CBLAS_INDEX