From 19fcd6bc6a14052d9728b04b23709eb236f0142b Mon Sep 17 00:00:00 2001 From: Keith Lazuka Date: Mon, 14 Sep 2009 08:50:58 -0400 Subject: [PATCH 1/4] 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 ) + + +
at ( key assoc -- value/f )
Factor handbook > The language > Collections > Associative mapping operations > Lookup and querying of assocs
Prev:key? ( key assoc -- ? )
Next:?at ( key assoc -- value/key ? )

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
USING: kernel ;
IN: assocs
: at ( key assoc -- value/f ) at* drop ; inline

+ \ No newline at end of file From 8b666df6dae465f5fa28f748d2f9c58b22a38e91 Mon Sep 17 00:00:00 2001 From: Keith Lazuka Date: Mon, 14 Sep 2009 09:01:03 -0400 Subject: [PATCH 2/4] 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 83f2a48853f2000321cd60b1e29869fa9001dcc9 Mon Sep 17 00:00:00 2001 From: Keith Lazuka Date: Mon, 14 Sep 2009 11:13:45 -0400 Subject: [PATCH 3/4] 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 7170e0cbfba9487dc0413b687062e6eefa13d7de Mon Sep 17 00:00:00 2001 From: Keith Lazuka Date: Mon, 14 Sep 2009 14:27:30 -0400 Subject: [PATCH 4/4] 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 ;