From a8d1cd313565865210a5616d57ea382e414026b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Br=C3=BCschweiler?= Date: Sun, 13 Sep 2009 21:40:58 +0200 Subject: [PATCH 01/11] xml-rpc: fix post-rpc --- basis/xml-rpc/xml-rpc.factor | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/basis/xml-rpc/xml-rpc.factor b/basis/xml-rpc/xml-rpc.factor index 690ebe94f8..370c778787 100644 --- a/basis/xml-rpc/xml-rpc.factor +++ b/basis/xml-rpc/xml-rpc.factor @@ -1,9 +1,10 @@ ! Copyright (C) 2005, 2009 Daniel Ehrenberg ! See http://factorcode.org/license.txt for BSD license. -USING: accessors kernel xml arrays math generic http.client -combinators hashtables namespaces io base64 sequences strings -calendar xml.data xml.writer xml.traversal assocs math.parser -debugger calendar.format math.order xml.syntax ; +USING: accessors arrays assocs base64 calendar calendar.format +combinators debugger generic hashtables http http.client +http.client.private io io.encodings.string io.encodings.utf8 +kernel math math.order math.parser namespaces sequences strings +xml xml.data xml.syntax xml.traversal xml.writer ; IN: xml-rpc ! * Sending RPC requests @@ -174,9 +175,20 @@ TAG: array xml>item ] [ "Bad main tag name" server-error ] if ] if ; +string utf8 encode "text/xml" swap >>data ; + +: rpc-post-request ( xml url -- request ) + [ send-rpc xml-post-data ] [ "POST" ] bi* + swap >>post-data ; + +PRIVATE> + : post-rpc ( rpc url -- rpc ) ! This needs to do something in the event of an error - [ send-rpc ] dip http-post nip string>xml receive-rpc ; + rpc-post-request http-request nip string>xml receive-rpc ; : invoke-method ( params method url -- response ) [ swap ] dip post-rpc ; From d0652d9d0bf98ccd5edad2df91a2db0451e87727 Mon Sep 17 00:00:00 2001 From: Keith Lazuka Date: Mon, 14 Sep 2009 08:50:58 -0400 Subject: [PATCH 02/11] help.stylesheet: fixed black border bug around nav links in HTML documentation --- basis/help/stylesheet/stylesheet.factor | 4 ++-- word-at,assocs.html | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 word-at,assocs.html diff --git a/basis/help/stylesheet/stylesheet.factor b/basis/help/stylesheet/stylesheet.factor index 2475fba0f6..88fe81de6e 100644 --- a/basis/help/stylesheet/stylesheet.factor +++ b/basis/help/stylesheet/stylesheet.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2005, 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: colors colors.constants io.styles literals namespaces ; +USING: colors colors.constants io.styles namespaces ; IN: help.stylesheet SYMBOL: default-span-style @@ -42,7 +42,7 @@ SYMBOL: help-path-style H{ { font-size 10 } { table-gap { 5 5 } } - { table-border $ transparent } + { table-border COLOR: FactorLightLightTan } } help-path-style set-global SYMBOL: heading-style diff --git a/word-at,assocs.html b/word-at,assocs.html new file mode 100644 index 0000000000..f0be85855a --- /dev/null +++ b/word-at,assocs.html @@ -0,0 +1,13 @@ + + + + + at ( key assoc -- value/f ) + + +
Vocabulary
assocs

Inputs and outputs
keyan object
assocan assoc
value/fthe value associated to the key, or f if the key is not present in the assoc


Word description
Looks up the value associated with a key. This word makes no distinction between a missing value and a value set to f; if the difference is important, use at*.

See also
at*, key?, ?at

Definition
: at ( key assoc -- value/f ) at* drop ; inline

+ \ No newline at end of file From 91c7eb9eea9366c59762dcb942ff3627730effdb Mon Sep 17 00:00:00 2001 From: Keith Lazuka Date: Mon, 14 Sep 2009 09:01:03 -0400 Subject: [PATCH 03/11] Renamed a Factor theme color to something more sensible. --- basis/colors/constants/factor-colors.txt | 4 ++-- basis/help/stylesheet/stylesheet.factor | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/basis/colors/constants/factor-colors.txt b/basis/colors/constants/factor-colors.txt index c032aae5c4..b8af9d3949 100644 --- a/basis/colors/constants/factor-colors.txt +++ b/basis/colors/constants/factor-colors.txt @@ -1,6 +1,6 @@ ! Factor UI theme colors -243 242 234 FactorLightLightTan -227 226 219 FactorLightTan +243 242 234 FactorLightTan +227 226 219 FactorTan 172 167 147 FactorDarkTan 81 91 105 FactorLightSlateBlue 55 62 72 FactorDarkSlateBlue diff --git a/basis/help/stylesheet/stylesheet.factor b/basis/help/stylesheet/stylesheet.factor index 88fe81de6e..8a119823cc 100644 --- a/basis/help/stylesheet/stylesheet.factor +++ b/basis/help/stylesheet/stylesheet.factor @@ -34,7 +34,7 @@ H{ { font-style bold } { wrap-margin 500 } { foreground COLOR: gray20 } - { page-color COLOR: FactorLightLightTan } + { page-color COLOR: FactorLightTan } { inset { 5 5 } } } title-style set-global @@ -42,7 +42,7 @@ SYMBOL: help-path-style H{ { font-size 10 } { table-gap { 5 5 } } - { table-border COLOR: FactorLightLightTan } + { table-border COLOR: FactorLightTan } } help-path-style set-global SYMBOL: heading-style @@ -75,7 +75,7 @@ H{ SYMBOL: code-style H{ - { page-color COLOR: FactorLightLightTan } + { page-color COLOR: FactorLightTan } { inset { 5 5 } } { wrap-margin f } } code-style set-global @@ -113,7 +113,7 @@ H{ SYMBOL: table-style H{ { table-gap { 5 5 } } - { table-border COLOR: FactorLightTan } + { table-border COLOR: FactorTan } } table-style set-global SYMBOL: list-style From fad3d47a8b05c358b5b07041f1dc79674411b226 Mon Sep 17 00:00:00 2001 From: Keith Lazuka Date: Mon, 14 Sep 2009 11:13:45 -0400 Subject: [PATCH 04/11] help.vocabs: inform the user when browsing a vocab that is not loaded. --- basis/help/vocabs/vocabs.factor | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/basis/help/vocabs/vocabs.factor b/basis/help/vocabs/vocabs.factor index e8b145d37e..a7cd70707d 100644 --- a/basis/help/vocabs/vocabs.factor +++ b/basis/help/vocabs/vocabs.factor @@ -227,6 +227,15 @@ C: vocab-author ] bi ] unless-empty ; +: vocab-is-not-loaded ( vocab -- ) + "Attention" $heading + vocab-name dup "The " " vocabulary is not loaded. In order to browse " + "its documentation, you must first load it." append surround print-element + "USE: " prepend 1array $code ; + +: describe-words ( vocab -- ) + dup vocab [ words $words ] [ vocab-is-not-loaded ] if ; + : words. ( vocab -- ) last-element off [ require ] [ words $words ] bi nl ; @@ -243,7 +252,7 @@ C: vocab-author first { [ describe-help ] [ describe-metadata ] - [ words $words ] + [ describe-words ] [ describe-files ] [ describe-children ] } cleave ; From b6d57a4d19c02f68f5dc2c1d4d243b511baab0f2 Mon Sep 17 00:00:00 2001 From: Keith Lazuka Date: Mon, 14 Sep 2009 14:27:30 -0400 Subject: [PATCH 05/11] help.vocabs: tweaked the vocab-not-loaded msg --- basis/help/vocabs/vocabs.factor | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/basis/help/vocabs/vocabs.factor b/basis/help/vocabs/vocabs.factor index a7cd70707d..6e2fd6f278 100644 --- a/basis/help/vocabs/vocabs.factor +++ b/basis/help/vocabs/vocabs.factor @@ -228,10 +228,9 @@ C: vocab-author ] unless-empty ; : vocab-is-not-loaded ( vocab -- ) - "Attention" $heading - vocab-name dup "The " " vocabulary is not loaded. In order to browse " - "its documentation, you must first load it." append surround print-element - "USE: " prepend 1array $code ; + "Words" $heading + "You must first load (USE:) this vocab to browse its documentation/words." + print-element vocab-name "USE: " prepend 1array $code ; : describe-words ( vocab -- ) dup vocab [ words $words ] [ vocab-is-not-loaded ] if ; From 111d298cea146a2f723e0090d6c5d4a345323d53 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 14 Sep 2009 16:14:53 -0500 Subject: [PATCH 06/11] Remove bogus file --- word-at,assocs.html | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 word-at,assocs.html diff --git a/word-at,assocs.html b/word-at,assocs.html deleted file mode 100644 index f0be85855a..0000000000 --- a/word-at,assocs.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - at ( key assoc -- value/f ) - - -
Vocabulary
assocs

Inputs and outputs
keyan object
assocan assoc
value/fthe value associated to the key, or f if the key is not present in the assoc


Word description
Looks up the value associated with a key. This word makes no distinction between a missing value and a value set to f; if the difference is important, use at*.

See also
at*, key?, ?at

Definition
: at ( key assoc -- value/f ) at* drop ; inline

- \ No newline at end of file From d772bff8b903d379f474b1790fd94d17853791ce Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 14 Sep 2009 16:19:36 -0500 Subject: [PATCH 07/11] help.vocabs: tweak 'not loaded' message some more --- basis/help/vocabs/vocabs.factor | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/basis/help/vocabs/vocabs.factor b/basis/help/vocabs/vocabs.factor index 6e2fd6f278..d8f351f57d 100644 --- a/basis/help/vocabs/vocabs.factor +++ b/basis/help/vocabs/vocabs.factor @@ -228,12 +228,16 @@ C: vocab-author ] unless-empty ; : vocab-is-not-loaded ( vocab -- ) - "Words" $heading - "You must first load (USE:) this vocab to browse its documentation/words." + "Not loaded" $heading + "You must first load this vocabulary to browse its documentation and words." print-element vocab-name "USE: " prepend 1array $code ; : describe-words ( vocab -- ) - dup vocab [ words $words ] [ vocab-is-not-loaded ] if ; + { + { [ dup vocab ] [ words $words ] } + { [ dup find-vocab-root ] [ vocab-is-not-loaded ] } + [ drop ] + } cond ; : words. ( vocab -- ) last-element off From 4f702de449ba65d4c9f813e8b74e77471e7066aa Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 14 Sep 2009 16:19:58 -0500 Subject: [PATCH 08/11] math.functions: more accurate log10 (fixes problem reported by OneEyed) --- basis/compiler/cfg/intrinsics/intrinsics.factor | 1 + basis/math/functions/functions-tests.factor | 6 ++++++ basis/math/functions/functions.factor | 6 +++++- basis/math/libm/libm.factor | 3 +++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/basis/compiler/cfg/intrinsics/intrinsics.factor b/basis/compiler/cfg/intrinsics/intrinsics.factor index a54caf23de..0daab82395 100644 --- a/basis/compiler/cfg/intrinsics/intrinsics.factor +++ b/basis/compiler/cfg/intrinsics/intrinsics.factor @@ -129,6 +129,7 @@ IN: compiler.cfg.intrinsics { math.libm:ftanh [ drop "tanh" emit-unary-float-function ] } { math.libm:fexp [ drop "exp" emit-unary-float-function ] } { math.libm:flog [ drop "log" emit-unary-float-function ] } + { math.libm:flog10 [ drop "log10" emit-unary-float-function ] } { math.libm:fpow [ drop "pow" emit-binary-float-function ] } { math.libm:facosh [ drop "acosh" emit-unary-float-function ] } { math.libm:fasinh [ drop "asinh" emit-unary-float-function ] } diff --git a/basis/math/functions/functions-tests.factor b/basis/math/functions/functions-tests.factor index 7a6da72005..fa880f77af 100644 --- a/basis/math/functions/functions-tests.factor +++ b/basis/math/functions/functions-tests.factor @@ -33,6 +33,12 @@ IN: math.functions.tests [ 0.0 ] [ 1.0 log ] unit-test [ 1.0 ] [ e log ] unit-test +[ 0.0 ] [ 1.0 log10 ] unit-test +[ 1.0 ] [ 10.0 log10 ] unit-test +[ 2.0 ] [ 100.0 log10 ] unit-test +[ 3.0 ] [ 1000.0 log10 ] unit-test +[ 4.0 ] [ 10000.0 log10 ] unit-test + [ t ] [ 1 exp e 1.e-10 ~ ] unit-test [ t ] [ 1.0 exp e 1.e-10 ~ ] unit-test [ t ] [ -1 exp e * 1.0 1.e-10 ~ ] unit-test diff --git a/basis/math/functions/functions.factor b/basis/math/functions/functions.factor index 0cf9467795..f124c202b8 100644 --- a/basis/math/functions/functions.factor +++ b/basis/math/functions/functions.factor @@ -173,7 +173,11 @@ M: float log1+ dup -1.0 >= [ flog1+ ] [ 1.0 + 0.0 rect> log ] if ; inline : 10^ ( x -- y ) 10 swap ^ ; inline -: log10 ( x -- y ) log 10 log / ; inline +GENERIC: log10 ( x -- y ) foldable + +M: real log10 >float flog10 ; inline + +M: complex log10 log 10 log / ; inline GENERIC: cos ( x -- y ) foldable diff --git a/basis/math/libm/libm.factor b/basis/math/libm/libm.factor index 1ac0ec0ae7..df8b36fd28 100644 --- a/basis/math/libm/libm.factor +++ b/basis/math/libm/libm.factor @@ -39,6 +39,9 @@ IN: math.libm : flog ( x -- y ) "double" "libm" "log" { "double" } alien-invoke ; +: flog10 ( x -- y ) + "double" "libm" "log10" { "double" } alien-invoke ; + : fpow ( x y -- z ) "double" "libm" "pow" { "double" "double" } alien-invoke ; From ded68c67c03c11b9187023df9b10e98f3cb69e9d Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 14 Sep 2009 20:26:59 -0500 Subject: [PATCH 09/11] Fix bootstrap --- basis/prettyprint/config/config.factor | 2 +- basis/vocabs/prettyprint/prettyprint.factor | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/basis/prettyprint/config/config.factor b/basis/prettyprint/config/config.factor index 45557925a5..dd61e3e23d 100644 --- a/basis/prettyprint/config/config.factor +++ b/basis/prettyprint/config/config.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2003, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: arrays generic assocs io kernel math -namespaces sequences strings io.styles vectors words +namespaces sequences strings vectors words continuations ; IN: prettyprint.config diff --git a/basis/vocabs/prettyprint/prettyprint.factor b/basis/vocabs/prettyprint/prettyprint.factor index 6b759dddde..40493e4e99 100644 --- a/basis/vocabs/prettyprint/prettyprint.factor +++ b/basis/vocabs/prettyprint/prettyprint.factor @@ -88,7 +88,7 @@ PRIVATE> "at the top of the source file:" print nl ] with-style { - { page-color COLOR: FactorLightLightTan } + { page-color COLOR: FactorLightTan } { border-color COLOR: FactorDarkTan } { inset { 5 5 } } } [ manifest get pprint-manifest ] with-nesting From 05fe9c7eadbab785dfdb46b873d9d797effd076a Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 14 Sep 2009 21:03:33 -0500 Subject: [PATCH 10/11] colors.constants: clean up naming --- basis/colors/constants/constants.factor | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/basis/colors/constants/constants.factor b/basis/colors/constants/constants.factor index 3912994066..8598fc0663 100644 --- a/basis/colors/constants/constants.factor +++ b/basis/colors/constants/constants.factor @@ -11,23 +11,23 @@ IN: colors.constants [ [ string>number 255 /f ] tri@ 1.0 ] dip [ blank? ] trim-head { { CHAR: \s CHAR: - } } substitute swap ; -: parse-rgb.txt ( lines -- assoc ) +: parse-colors ( lines -- assoc ) [ "!" head? not ] filter [ 11 cut [ " \t" split harvest ] dip suffix ] map [ parse-color ] H{ } map>assoc ; -MEMO: rgb.txt ( -- assoc ) +MEMO: colors ( -- assoc ) "resource:basis/colors/constants/rgb.txt" "resource:basis/colors/constants/factor-colors.txt" - [ utf8 file-lines parse-rgb.txt ] bi@ assoc-union ; + [ utf8 file-lines parse-colors ] bi@ assoc-union ; PRIVATE> -: named-colors ( -- keys ) rgb.txt keys ; +: named-colors ( -- keys ) colors keys ; ERROR: no-such-color name ; : named-color ( name -- color ) - dup rgb.txt at [ ] [ no-such-color ] ?if ; + dup colors at [ ] [ no-such-color ] ?if ; SYNTAX: COLOR: scan named-color parsed ; \ No newline at end of file From 3551294fd42cff1e7ea1baf195f4118e10cee735 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 15 Sep 2009 00:22:19 -0500 Subject: [PATCH 11/11] vm: update Config.netbsd for NetBSD 5.0 --- vm/Config.netbsd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vm/Config.netbsd b/vm/Config.netbsd index a6ec997ecd..ba5ecd19a5 100644 --- a/vm/Config.netbsd +++ b/vm/Config.netbsd @@ -1,5 +1,5 @@ include vm/Config.unix PLAF_DLL_OBJS += vm/os-genunix.o vm/os-netbsd.o CFLAGS += -export-dynamic -LIBPATH = -L/usr/X11R6/lib -Wl,-rpath,/usr/X11R6/lib -L/usr/pkg/lib -Wl,-rpath,/usr/pkg/lib +LIBPATH = -L/usr/X11R7/lib -Wl,-rpath,/usr/X11R7/lib -L/usr/pkg/lib -Wl,-rpath,/usr/pkg/lib LIBS = -lm -lssl -lcrypto $(X11_UI_LIBS)