! Try to find the library from a list, but if it's not found,
! try to open a library that is the first name in that list anyway
-! or "library_not_found" as a last resort for better debugging.
+! or "library_not_found" as a last resort for better debugging.
: find-library-from-list ( seq -- path/f )
dup [ find-library* ] map-find drop
[ nip ] [ ?first "library_not_found" or ] if* ;
! Copyright (C) 2005 Chris Double. All Rights Reserved.
! See http://factorcode.org/license.txt for BSD license.
!
-USING: kernel tools.test math channels channels.private
+USING: kernel tools.test math channels channels.private
sequences threads sorting ;
IN: channels.tests
CONSTANT: NSResizableWindowMask 8
CONSTANT: NSTexturedBackgroundWindowMask 256
-! Additional panel-only styles
+! Additional panel-only styles
CONSTANT: NSUtilityWindowMask 16
CONSTANT: NSDocModalWindowMask 64
CONSTANT: NSNonactivatingPanelMask 128
{ { 0x66 0x0f 0x71 0xd0 0x05 } } [ [ XMM0 5 PSRLW ] { } make ] unit-test
{ { 0x66 0x0f 0xd1 0xc1 } } [ [ XMM0 XMM1 PSRLW ] { } make ] unit-test
-! sse comparison instructions
+! sse comparison instructions
{ { 0x66 0x0f 0xc2 0xc1 0x02 } } [ [ XMM0 XMM1 CMPLEPD ] { } make ] unit-test
! unique sse instructions
! Return values from sqlite functions
CONSTANT: SQLITE_OK 0 ! Successful result
CONSTANT: SQLITE_ERROR 1 ! SQL error or missing database
-CONSTANT: SQLITE_INTERNAL 2 ! An internal logic error in SQLite
-CONSTANT: SQLITE_PERM 3 ! Access permission denied
-CONSTANT: SQLITE_ABORT 4 ! Callback routine requested an abort
-CONSTANT: SQLITE_BUSY 5 ! The database file is locked
-CONSTANT: SQLITE_LOCKED 6 ! A table in the database is locked
-CONSTANT: SQLITE_NOMEM 7 ! A malloc() failed
-CONSTANT: SQLITE_READONLY 8 ! Attempt to write a readonly database
-CONSTANT: SQLITE_INTERRUPT 9 ! Operation terminated by sqlite_interrupt()
-CONSTANT: SQLITE_IOERR 10 ! Some kind of disk I/O error occurred
-CONSTANT: SQLITE_CORRUPT 11 ! The database disk image is malformed
-CONSTANT: SQLITE_NOTFOUND 12 ! (Internal Only) Table or record not found
-CONSTANT: SQLITE_FULL 13 ! Insertion failed because database is full
-CONSTANT: SQLITE_CANTOPEN 14 ! Unable to open the database file
-CONSTANT: SQLITE_PROTOCOL 15 ! Database lock protocol error
-CONSTANT: SQLITE_EMPTY 16 ! (Internal Only) Database table is empty
-CONSTANT: SQLITE_SCHEMA 17 ! The database schema changed
-CONSTANT: SQLITE_TOOBIG 18 ! Too much data for one row of a table
-CONSTANT: SQLITE_CONSTRAINT 19 ! Abort due to contraint violation
-CONSTANT: SQLITE_MISMATCH 20 ! Data type mismatch
-CONSTANT: SQLITE_MISUSE 21 ! Library used incorrectly
-CONSTANT: SQLITE_NOLFS 22 ! Uses OS features not supported on host
-CONSTANT: SQLITE_AUTH 23 ! Authorization denied
+CONSTANT: SQLITE_INTERNAL 2 ! An internal logic error in SQLite
+CONSTANT: SQLITE_PERM 3 ! Access permission denied
+CONSTANT: SQLITE_ABORT 4 ! Callback routine requested an abort
+CONSTANT: SQLITE_BUSY 5 ! The database file is locked
+CONSTANT: SQLITE_LOCKED 6 ! A table in the database is locked
+CONSTANT: SQLITE_NOMEM 7 ! A malloc() failed
+CONSTANT: SQLITE_READONLY 8 ! Attempt to write a readonly database
+CONSTANT: SQLITE_INTERRUPT 9 ! Operation terminated by sqlite_interrupt()
+CONSTANT: SQLITE_IOERR 10 ! Some kind of disk I/O error occurred
+CONSTANT: SQLITE_CORRUPT 11 ! The database disk image is malformed
+CONSTANT: SQLITE_NOTFOUND 12 ! (Internal Only) Table or record not found
+CONSTANT: SQLITE_FULL 13 ! Insertion failed because database is full
+CONSTANT: SQLITE_CANTOPEN 14 ! Unable to open the database file
+CONSTANT: SQLITE_PROTOCOL 15 ! Database lock protocol error
+CONSTANT: SQLITE_EMPTY 16 ! (Internal Only) Database table is empty
+CONSTANT: SQLITE_SCHEMA 17 ! The database schema changed
+CONSTANT: SQLITE_TOOBIG 18 ! Too much data for one row of a table
+CONSTANT: SQLITE_CONSTRAINT 19 ! Abort due to contraint violation
+CONSTANT: SQLITE_MISMATCH 20 ! Data type mismatch
+CONSTANT: SQLITE_MISUSE 21 ! Library used incorrectly
+CONSTANT: SQLITE_NOLFS 22 ! Uses OS features not supported on host
+CONSTANT: SQLITE_AUTH 23 ! Authorization denied
CONSTANT: SQLITE_FORMAT 24 ! Auxiliary database format error
CONSTANT: SQLITE_RANGE 25 ! 2nd parameter to sqlite3_bind out of range
CONSTANT: SQLITE_NOTADB 26 ! File opened that is not a database file
CONSTANT: SQLITE_BLOB 4
CONSTANT: SQLITE_NULL 5
-! Values for the 'destructor' parameter of the 'bind' routines.
+! Values for the 'destructor' parameter of the 'bind' routines.
CONSTANT: SQLITE_STATIC 0
CONSTANT: SQLITE_TRANSIENT -1
IN: generalizations
! These words can be inline combinators the word does no math on
-! the input parameters, e.g. n.
+! the input parameters, e.g. n.
! If math is done, the word needs to be a macro so the math can
! be done at compile-time.
<<
] }
{ CHAR: $ [
dup stream-read1 {
- { CHAR: @ [ drop jis208 get-global ] } ! want: JIS X 0208-1978
+ { CHAR: @ [ drop jis208 get-global ] } ! want: JIS X 0208-1978
{ CHAR: B [ drop jis208 get-global ] }
{ CHAR: ( [
stream-read1 CHAR: D = jis212 get-global f ?
USING: arrays generic kernel math models namespaces sequences assocs
tools.test models.range ;
-! Test <range>
+! Test <range>
: setup-range ( -- range ) 0 0 0 255 1 <range> ;
: setup-stepped-range ( -- range ) 0 0 0 255 2 <range> ;
! Copyright (C) 2005, 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
-! mersenne twister based on
+! mersenne twister based on
! http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/CODES/mt19937ar.c
USING: accessors alien.c-types alien.data fry init kernel math
math.bitwise namespaces random sequences sequences.private
medial-base - + final-count *
] dip final-base - + hangul-base + ;
-! Normalization -- Decomposition
+! Normalization -- Decomposition
: reorder-slice ( string start -- slice done? )
2dup swap [ non-starter? not ] find-from drop
CONSTANT: RevertToParent 2
! *****************************************************************
-! * ERROR CODES
+! * ERROR CODES
! *****************************************************************
CONSTANT: Success 0 ! everything's okay
CONSTANT: BadDrawable 9 ! parameter not a Pixmap or Window
CONSTANT: BadAccess 10 ! depending on context:
! - key/button already grabbed
- ! - attempt to free an illegal
- ! cmap entry
- ! - attempt to store into a read-only
+ ! - attempt to free an illegal
+ ! cmap entry
+ ! - attempt to store into a read-only
! color map entry.
! - attempt to modify the access control
! list from other than the local host.
CONSTANT: LastExtensionError 255
! *****************************************************************
-! * WINDOW DEFINITIONS
+! * WINDOW DEFINITIONS
! *****************************************************************
! Window classes used by CreateWindow
CONSTANT: ArcPieSlice 1 ! join endpoints to center of arc
! *****************************************************************
-! * FONTS
+! * FONTS
! *****************************************************************
! used in QueryFont -- draw direction
CONSTANT: FontChange 255
! *****************************************************************
-! * IMAGING
+! * IMAGING
! *****************************************************************
! ImageFormat -- PutImage, GetImage
CONSTANT: ZPixmap 2 ! depth == drawable depth
! *****************************************************************
-! * COLOR MAP STUFF
+! * COLOR MAP STUFF
! *****************************************************************
! For CreateColormap
CONSTANT: TileShape 1 ! size tiled fastest
CONSTANT: StippleShape 2 ! size stippled fastest
-! *****************************************************************
+! *****************************************************************
! * KEYBOARD/POINTER STUFF
! *****************************************************************
CONSTANT: MappingPointer 2
! *****************************************************************
-! * SCREEN SAVER STUFF
+! * SCREEN SAVER STUFF
! *****************************************************************
CONSTANT: DontPreferBlanking 0
CONSTANT: EnableAccess 1
CONSTANT: DisableAccess 0
-! Display classes used in opening the connection
+! Display classes used in opening the connection
! Note that the statically allocated ones are even numbered and the
! dynamically changeable ones are odd numbered
: next-uuid ( server -- uuid )
ensure-uuids uuids>> pop ;
-! db
+! db
TUPLE: db { server server } { name string } ;
C: <db> db
! H{ } clone "name" pick set-at "content-type" pick set-at ;
!
! : add-attachment ( assoc name attachment -- )
-! pick attachments> [ H{ } clone ] unless*
+! pick attachments> [ H{ } clone ] unless*
!
! : attach ( assoc name content-type data -- )
! construct-attachment H{ } clone
etag-vector =
] unit-test
-! etag-pair
+! etag-pair
{ t }
[
{ if 28 }
[ parent-directory make-directories ] keep ;
! : path>next-vnode-version-name ( path -- path' )
- ! [ file-name ]
+ ! [ file-name ]
! place first rect at x 0
! place rects that fit in remaining stripe
! pack stripes(y + height)
-! if height > max height
+! if height > max height
TUPLE: image-placement
{ image read-only }
! test that when changing the model, the gadget updates the texture.
! - same size images (both smaller than 512x512) (updates)
! test that when changing the model, the gadget creates a new texture.
-! test different cases :
+! test different cases :
! - same size images (both bigger than 512x512) (creates)
! - different size images (both smaller than 512x512) (creates)
! - different size images (both bigger than 512x512) (creates)
acl-entry>flagset flagset>strings ;
-! Acl, acl entry, principal, group,
+! Acl, acl entry, principal, group,
! acl_get_qualifier, acl_get_tag_type, acl_get_flagset_np,
! acl_get_permset
DOUBLE-COMPLEX ALPHA, DOUBLE-COMPLEX(*) X, INTEGER INCX,
DOUBLE-COMPLEX(*) Y, INTEGER INCY, DOUBLE-COMPLEX(*) AP ) ;
-! LEVEL 3 BLAS (MATRIX-MATRIX)
+! LEVEL 3 BLAS (MATRIX-MATRIX)
SUBROUTINE: SGEMM ( CHARACTER*1 TRANSA,
CHARACTER*1 TRANSB, INTEGER M, INTEGER N,
DERIVATIVE: - [ 2drop ] [ 2drop neg ]
DERIVATIVE: * [ nip * ] [ drop * ]
DERIVATIVE: / [ nip / ] [ sq / neg * ]
-! Conditional checks if the epsilon-part of the exponent is
+! Conditional checks if the epsilon-part of the exponent is
! 0 to avoid getting float answers for integer powers.
DERIVATIVE: ^ [ [ 1 - ^ ] keep * * ]
[ [ dup zero? ] 2dip [ 3drop 0 ] [ [ ^ ] keep log * * ] if ]
C: <dual> dual
-! Ordinary numbers implement the dual protocol by returning
+! Ordinary numbers implement the dual protocol by returning
! themselves as the ordinary part, and 0 as the epsilon part.
M: number ordinary-part>> ;
[ input-length ] keep
'[ [ ordinary-part>> ] _ napply _ execute ] ;
-! Takes N dual numbers <o1,e1> <o2,e2> ... <oN,eN> and weaves
+! Takes N dual numbers <o1,e1> <o2,e2> ... <oN,eN> and weaves
! their ordinary and epsilon parts to produce
! e1 o1 o2 ... oN e2 o1 o2 ... oN ... eN o1 o2 ... oN
-! This allows a set of partial derivatives each to be evaluated
+! This allows a set of partial derivatives each to be evaluated
! at the same point.
MACRO: duals>nweave ( n -- )
dup dup dup
T{ mongodb-cmd f "logout" t f f H{ { "logout" 1 } } }
! Value: { "findandmodify" collection-name }
-! Options: { { "query" selector } { "sort" sort-spec }
-! { "remove" t/f } { "update" modified-object }
+! Options: { { "query" selector } { "sort" sort-spec }
+! { "remove" t/f } { "update" modified-object }
! { "new" t/f } }
CONSTANT: findandmodify-cmd
T{ mongodb-cmd f "findandmodify" f f f H{ { "findandmodify" f } } }
} cond ;
: write-tuple-fields ( mirror tuple assoc quot: ( tuple -- assoc ) -- )
- swap ! m t q q a
+ swap ! m t q q a
'[ _ 2over write-field?
[ _ write-field swap _ set-at ]
[ 2drop ] if
[ [ { 7 8 } ] dip nths (time) ] ! ref-timestamp
[ [ { 9 10 } ] dip nths (time) ] ! orig-timestamp
[ [ { 11 12 } ] dip nths (time) ] ! recv-timestamp
- [ [ { 13 14 } ] dip nths (time) ] ! tx-timestamp
+ [ [ { 13 14 } ] dip nths (time) ] ! tx-timestamp
} cleave ntp boa
dup stratum>> '[ _ (ref-id) ] change-ref-id
[ dup (leap) 2array ] change-leap
! Copyright (C) 2007 Chris Double.
! See http://factorcode.org/license.txt for BSD license.
!
-USING:
+USING:
alien
alien.c-types
alien.libraries
! Copyright (C) 2007 Chris Double.
! See http://factorcode.org/license.txt for BSD license.
!
-USING:
+USING:
alien
alien.c-types
alien.libraries
! Copyright (C) 2007 Chris Double.
! See http://factorcode.org/license.txt for BSD license.
!
-USING:
+USING:
alien
alien.c-types
alien.libraries
! Copyright (C) 2008 Chris Double.
! See http://factorcode.org/license.txt for BSD license.
!
-USING: kernel tools.test peg peg.javascript.ast peg.javascript.parser
+USING: kernel tools.test peg peg.javascript.ast peg.javascript.parser
accessors sequences math peg.ebnf peg.ebnf.private ;
IN: peg.javascript.parser.tests
! Copyright (C) 2007 Chris Double.
! See http://factorcode.org/license.txt for BSD license.
!
-USING: kernel tools.test peg peg.ebnf peg.ebnf.private peg.pl0
+USING: kernel tools.test peg peg.ebnf peg.ebnf.private peg.pl0
sequences accessors ;
IN: peg.pl0.tests
! +OK Password required
! PASS password
! +OK Logged in
-! STAT
+! STAT
! +OK 2 1753
! LIST
! +OK 2 messages:
! 1 + - = - ; 1 + ----- = - ; 1 + --------- = -- ; 1 + ------------- = --
! 2 2 1 5 1 12 1 29
! 2 + - 2 + ----- 2 + ---------
-! 2 1 1
+! 2 1 1
! 2 + - 2 + -----
! 2 1
! 2 + -
unicode.case unicode.categories urls ;
IN: robots
-! visit-time is GMT, request-rate is pages/second
+! visit-time is GMT, request-rate is pages/second
! crawl-rate is seconds
SYMBOL: robot-identities
! * Parentheses
! * Multiplication/Division (left to right)
-! * Addition/Subtraction (left to right)
+! * Addition/Subtraction (left to right)
TUPLE: operator left right ;
TUPLE: add < operator ; C: <add> add
! Napier's constant
SINGLETON: napier
M: napier cfrac-a
- ! If n is 1, then a_n is 2, else a_n is n - 1.
+ ! If n is 1, then a_n is 2, else a_n is n - 1.
drop { { 1 [ 2 ] } [ 1 - ] } case ;
M: napier cfrac-b
! If n is 1, then b_n is 1, else b_n is n - 1.
! if Py = Ay or Py = By then
! Py ← Py + ε
! end if
-! if Py < Ay or Py > By then
+! if Py < Ay or Py > By then
! return false
-! else if Px > max(Ax, Bx) then
+! else if Px > max(Ax, Bx) then
! return false
! else
! if Px < min(Ax, Bx) then
IN: taxes.usa.federal
! http://www.irs.gov/pub/irs-pdf/p15.pdf
-! Table 7 ANNUAL Payroll Period
+! Table 7 ANNUAL Payroll Period
: federal-single ( -- triples )
{