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 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/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/help/stylesheet/stylesheet.factor b/basis/help/stylesheet/stylesheet.factor index 2475fba0f6..8a119823cc 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 @@ -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 $ transparent } + { 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 diff --git a/basis/help/vocabs/vocabs.factor b/basis/help/vocabs/vocabs.factor index e8b145d37e..d8f351f57d 100644 --- a/basis/help/vocabs/vocabs.factor +++ b/basis/help/vocabs/vocabs.factor @@ -227,6 +227,18 @@ C: vocab-author ] bi ] unless-empty ; +: vocab-is-not-loaded ( vocab -- ) + "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 ] } + { [ dup find-vocab-root ] [ vocab-is-not-loaded ] } + [ drop ] + } cond ; + : words. ( vocab -- ) last-element off [ require ] [ words $words ] bi nl ; @@ -243,7 +255,7 @@ C: vocab-author first { [ describe-help ] [ describe-metadata ] - [ words $words ] + [ describe-words ] [ describe-files ] [ describe-children ] } cleave ; diff --git a/basis/math/functions/functions-docs.factor b/basis/math/functions/functions-docs.factor index d61ad9a14a..fb392191d4 100644 --- a/basis/math/functions/functions-docs.factor +++ b/basis/math/functions/functions-docs.factor @@ -48,6 +48,7 @@ ARTICLE: "power-functions" "Powers and logarithms" { $subsection exp } { $subsection cis } { $subsection log } +"Other logarithms:" { $subsection log1+ } { $subsection log10 } "Raising a number to a power:" 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-docs.factor b/basis/math/libm/libm-docs.factor index abbb6f1289..64f6026f0b 100644 --- a/basis/math/libm/libm-docs.factor +++ b/basis/math/libm/libm-docs.factor @@ -6,7 +6,7 @@ ARTICLE: "math.libm" "C standard library math functions" { $warning "These functions are unsafe. The compiler special-cases them to operate on floats only. They can be called directly, however there is little reason to do so, since they only implement real-valued functions, and in some cases place restrictions on the domain:" { $example "USE: math.functions" "2.0 acos ." "C{ 0.0 1.316957896924817 }" } -{ $unchecked-example "USE: math.libm" "2 facos ." "0/0." } } +{ $unchecked-example "USE: math.libm" "2.0 facos ." "0/0." } } "Trigonometric functions:" { $subsection fcos } { $subsection fsin } @@ -20,6 +20,7 @@ ARTICLE: "math.libm" "C standard library math functions" "Exponentials and logarithms:" { $subsection fexp } { $subsection flog } +{ $subsection flog10 } "Powers:" { $subsection fpow } { $subsection fsqrt } ; @@ -66,6 +67,10 @@ HELP: flog { $values { "x" real } { "y" real } } { $description "Calls the natural logarithm function from the C standard library. User code should call " { $link log } " instead." } ; +HELP: flog10 +{ $values { "x" real } { "y" real } } +{ $description "Calls the base 10 logarithm function from the C standard library. User code should call " { $link log10 } " instead." } ; + HELP: fpow { $values { "x" real } { "y" real } { "z" real } } { $description "Calls the power function (" { $snippet "z=x^y" } ") from the C standard library. User code should call " { $link ^ } " instead." } ; 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 ; 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 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 ; 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)