Merge branch 'master' of git://factorcode.org/git/factor
commit
cec33d8d45
|
@ -173,7 +173,7 @@ HELP: with-db
|
||||||
HELP: with-transaction
|
HELP: with-transaction
|
||||||
{ $values
|
{ $values
|
||||||
{ "quot" quotation } }
|
{ "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"
|
ARTICLE: "db" "Database library"
|
||||||
"Accessing a database:"
|
"Accessing a database:"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2008 Doug Coleman.
|
! Copyright (C) 2008 Doug Coleman.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: classes hashtables help.markup help.syntax io.streams.string
|
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
|
IN: db.types
|
||||||
|
|
||||||
HELP: +db-assigned-id+
|
HELP: +db-assigned-id+
|
||||||
|
@ -27,15 +27,11 @@ HELP: +user-assigned-id+
|
||||||
|
|
||||||
HELP: <generator-bind>
|
HELP: <generator-bind>
|
||||||
{ $values { "slot-name" object } { "key" object } { "generator-singleton" object } { "type" object } { "generator-bind" generator-bind } }
|
{ $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: <literal-bind>
|
HELP: <literal-bind>
|
||||||
{ $values { "key" object } { "type" object } { "value" object } { "literal-bind" literal-bind } }
|
{ $values { "key" object } { "type" object } { "value" object } { "literal-bind" literal-bind } }
|
||||||
{ $description "" } ;
|
{ $description "An internal constructor for creating objects containing parameters used for binding literal values to a tuple query." } ;
|
||||||
|
|
||||||
HELP: <low-level-binding>
|
|
||||||
{ $values { "value" object } { "low-level-binding" low-level-binding } }
|
|
||||||
{ $description "" } ;
|
|
||||||
|
|
||||||
HELP: BIG-INTEGER
|
HELP: BIG-INTEGER
|
||||||
{ $description "A 64-bit integer. Whether this number is signed or unsigned depends on the database backend." } ;
|
{ $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#
|
HELP: bind#
|
||||||
{ $values
|
{ $values
|
||||||
{ "spec" "a sql spec" } { "obj" object } }
|
{ "spec" "a sql spec" } { "obj" object } }
|
||||||
{ $description "" } ;
|
{ $description "A generic word that lets a database construct a literal binding." } ;
|
||||||
|
|
||||||
HELP: bind%
|
HELP: bind%
|
||||||
{ $values
|
{ $values
|
||||||
{ "spec" "a sql spec" } }
|
{ "spec" "a sql spec" } }
|
||||||
{ $description "" } ;
|
{ $description "A generic word that lets a database output a binding." } ;
|
||||||
|
|
||||||
HELP: compound
|
|
||||||
{ $values
|
|
||||||
{ "string" string } { "obj" object }
|
|
||||||
{ "hash" hashtable } }
|
|
||||||
{ $description "" } ;
|
|
||||||
|
|
||||||
HELP: db-assigned-id-spec?
|
HELP: db-assigned-id-spec?
|
||||||
{ $values
|
{ $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." }
|
{ $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." } ;
|
{ $notes "This is a low-level word." } ;
|
||||||
|
|
||||||
HELP: generator-bind
|
|
||||||
{ $description "" } ;
|
|
||||||
|
|
||||||
HELP: get-slot-named
|
HELP: get-slot-named
|
||||||
{ $values
|
{ $values
|
||||||
{ "name" "a slot name" } { "tuple" tuple }
|
{ "name" "a slot name" } { "tuple" tuple }
|
||||||
{ "value" "the value stored in the slot" } }
|
{ "value" "the value stored in the slot" } }
|
||||||
{ $description "Returns the value stored in a tuple slot, where the tuple slot is a string." } ;
|
{ $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
|
HELP: no-sql-type
|
||||||
{ $values
|
{ $values
|
||||||
{ "type" "a sql type" } }
|
{ "type" "a sql type" } }
|
||||||
|
@ -173,7 +130,7 @@ HELP: no-sql-type
|
||||||
HELP: normalize-spec
|
HELP: normalize-spec
|
||||||
{ $values
|
{ $values
|
||||||
{ "spec" "a sql spec" } }
|
{ "spec" "a sql spec" } }
|
||||||
{ $description "" } ;
|
{ $description "Normalizes a sql spec." } ;
|
||||||
|
|
||||||
HELP: offset-of-slot
|
HELP: offset-of-slot
|
||||||
{ $values
|
{ $values
|
||||||
|
@ -181,52 +138,20 @@ HELP: offset-of-slot
|
||||||
{ "n" integer } }
|
{ "n" integer } }
|
||||||
{ $description "Returns the offset of a tuple slot accessed by name." } ;
|
{ $description "Returns the offset of a tuple slot accessed by name." } ;
|
||||||
|
|
||||||
HELP: persistent-table
|
|
||||||
{ $values
|
|
||||||
|
|
||||||
{ "hash" hashtable } }
|
|
||||||
{ $description "" } ;
|
|
||||||
|
|
||||||
HELP: primary-key?
|
HELP: primary-key?
|
||||||
{ $values
|
{ $values
|
||||||
{ "spec" "a sql spec" }
|
{ "spec" "a sql spec" }
|
||||||
{ "?" "a boolean" } }
|
{ "?" "a boolean" } }
|
||||||
{ $description "" } ;
|
{ $description "Returns true if a sql spec is a primary key." } ;
|
||||||
|
|
||||||
HELP: random-id-generator
|
HELP: random-id-generator
|
||||||
{ $description "" } ;
|
{ $description "Used to tell " { $link eval-generator } " to generate a random number for use as a key." } ;
|
||||||
|
|
||||||
HELP: relation?
|
HELP: relation?
|
||||||
{ $values
|
{ $values
|
||||||
{ "spec" "a sql spec" }
|
{ "spec" "a sql spec" }
|
||||||
{ "?" "a boolean" } }
|
{ "?" "a boolean" } }
|
||||||
{ $description "" } ;
|
{ $description "Returns true if a sql spec is a relation." } ;
|
||||||
|
|
||||||
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 "" } ;
|
|
||||||
|
|
||||||
HELP: unknown-modifier
|
HELP: unknown-modifier
|
||||||
{ $values { "modifier" string } }
|
{ $values { "modifier" string } }
|
||||||
|
|
|
@ -57,7 +57,7 @@ HELP: modify-redirect-query
|
||||||
|
|
||||||
HELP: nested-responders
|
HELP: nested-responders
|
||||||
{ $values { "seq" "a sequence of 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
|
HELP: referrer
|
||||||
{ $values { "referrer/f" { $maybe string } } }
|
{ $values { "referrer/f" { $maybe string } } }
|
||||||
|
@ -69,11 +69,11 @@ HELP: request-params
|
||||||
|
|
||||||
HELP: resolve-base-path
|
HELP: resolve-base-path
|
||||||
{ $values { "string" string } { "string'" string } }
|
{ $values { "string" string } { "string'" string } }
|
||||||
{ $description "" } ;
|
{ $description "Resolves a responder-relative URL." } ;
|
||||||
|
|
||||||
HELP: resolve-template-path
|
HELP: resolve-template-path
|
||||||
{ $values { "pair" "a pair with shape " { $snippet "{ class string }" } } { "path" "a pathname string" } }
|
{ $values { "pair" "a pair with shape " { $snippet "{ class string }" } } { "path" "a pathname string" } }
|
||||||
{ $description "" } ;
|
{ $description "Resolves a responder-relative template path." } ;
|
||||||
|
|
||||||
HELP: same-host?
|
HELP: same-host?
|
||||||
{ $values { "url" url } { "?" "a boolean" } }
|
{ $values { "url" url } { "?" "a boolean" } }
|
||||||
|
@ -85,7 +85,7 @@ HELP: user-agent
|
||||||
|
|
||||||
HELP: vocab-path
|
HELP: vocab-path
|
||||||
{ $values { "vocab" "a vocabulary specifier" } { "path" "a pathname string" } }
|
{ $values { "vocab" "a vocabulary specifier" } { "path" "a pathname string" } }
|
||||||
{ $description "" } ;
|
{ $description "Outputs the full pathname of the vocabulary's source directory." } ;
|
||||||
|
|
||||||
HELP: exit-with
|
HELP: exit-with
|
||||||
{ $values { "value" object } }
|
{ $values { "value" object } }
|
||||||
|
|
|
@ -1,36 +1,43 @@
|
||||||
USING: alien alien.c-types alien.syntax kernel system combinators ;
|
USING: alien alien.c-types alien.syntax kernel system combinators ;
|
||||||
IN: math.blas.cblas
|
IN: math.blas.cblas
|
||||||
|
|
||||||
<< "cblas" {
|
<<
|
||||||
|
: load-atlas ( -- )
|
||||||
|
"atlas" "libatlas.so" "cdecl" add-library ;
|
||||||
|
: load-blas ( -- )
|
||||||
|
"blas" "libblas.so" "cdecl" add-library ;
|
||||||
|
|
||||||
|
"cblas" {
|
||||||
{ [ os macosx? ] [ "libblas.dylib" "cdecl" add-library ] }
|
{ [ os macosx? ] [ "libblas.dylib" "cdecl" add-library ] }
|
||||||
{ [ os windows? ] [ "blas.dll" "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 ] }
|
{ [ os freebsd? ] [ "libcblas.so" "cdecl" add-library load-atlas ] }
|
||||||
[ "libblas.so" "cdecl" add-library ]
|
[ "libblas.so" "cdecl" add-library ]
|
||||||
} cond >>
|
} cond
|
||||||
|
>>
|
||||||
|
|
||||||
LIBRARY: cblas
|
LIBRARY: cblas
|
||||||
|
|
||||||
TYPEDEF: int CBLAS_ORDER
|
TYPEDEF: int CBLAS_ORDER
|
||||||
: CblasRowMajor 101 ; inline
|
CONSTANT: CblasRowMajor 101
|
||||||
: CblasColMajor 102 ; inline
|
CONSTANT: CblasColMajor 102
|
||||||
|
|
||||||
TYPEDEF: int CBLAS_TRANSPOSE
|
TYPEDEF: int CBLAS_TRANSPOSE
|
||||||
: CblasNoTrans 111 ; inline
|
CONSTANT: CblasNoTrans 111
|
||||||
: CblasTrans 112 ; inline
|
CONSTANT: CblasTrans 112
|
||||||
: CblasConjTrans 113 ; inline
|
CONSTANT: CblasConjTrans 113
|
||||||
|
|
||||||
TYPEDEF: int CBLAS_UPLO
|
TYPEDEF: int CBLAS_UPLO
|
||||||
: CblasUpper 121 ; inline
|
CONSTANT: CblasUpper 121
|
||||||
: CblasLower 122 ; inline
|
CONSTANT: CblasLower 122
|
||||||
|
|
||||||
TYPEDEF: int CBLAS_DIAG
|
TYPEDEF: int CBLAS_DIAG
|
||||||
: CblasNonUnit 131 ; inline
|
CONSTANT: CblasNonUnit 131
|
||||||
: CblasUnit 132 ; inline
|
CONSTANT: CblasUnit 132
|
||||||
|
|
||||||
TYPEDEF: int CBLAS_SIDE
|
TYPEDEF: int CBLAS_SIDE
|
||||||
: CblasLeft 141 ; inline
|
CONSTANT: CblasLeft 141
|
||||||
: CblasRight 142 ; inline
|
CONSTANT: CblasRight 142
|
||||||
|
|
||||||
TYPEDEF: int CBLAS_INDEX
|
TYPEDEF: int CBLAS_INDEX
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
! (c)2009 Joe Groff, see BSD license
|
||||||
USING: accessors arrays assocs fry kernel math math.affine-transforms math.constants
|
USING: accessors arrays assocs fry kernel math math.affine-transforms math.constants
|
||||||
math.functions math.parser math.vectors memoize peg.ebnf sequences sequences.squish
|
math.functions math.parser math.vectors memoize peg.ebnf sequences sequences.squish
|
||||||
splitting strings xml.data xml.utilities ;
|
splitting strings xml.data xml.utilities ;
|
||||||
|
|
|
@ -36,7 +36,7 @@ void init_ffi(void)
|
||||||
|
|
||||||
void ffi_dlopen(F_DLL *dll)
|
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)
|
void *ffi_dlsym(F_DLL *dll, F_SYMBOL *symbol)
|
||||||
|
|
Loading…
Reference in New Issue