drop recent-searches get [ <$link> ] map $list ;
: redisplay-recent-page ( -- )
- "help.home" >link dup associate
+ HS{ } clone "help.home" >link over adjoin
notify-definition-observers ;
: expire ( seq -- )
: add-recent ( obj -- )
add-recent-where dup
[ get [ adjoin ] [ expire ] bi ] [ 2drop ] if
- redisplay-recent-page ;
\ No newline at end of file
+ redisplay-recent-page ;
! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays assocs classes colors colors.constants
combinators combinators.smart compiler.units definitions
-definitions.icons effects fry generic hashtables help.stylesheet
-help.topics io io.styles kernel locals make math namespaces
-parser present prettyprint prettyprint.stylesheet quotations
-see sequences sequences.private sets slots sorting splitting
-strings urls vectors vocabs vocabs.loader words words.symbol ;
+definitions.icons effects fry generic hash-sets hashtables
+help.stylesheet help.topics io io.styles kernel locals make math
+namespaces parser present prettyprint prettyprint.stylesheet
+quotations see sequences sequences.private sets slots sorting
+splitting strings urls vectors vocabs vocabs.loader words
+words.symbol ;
FROM: prettyprint.sections => with-pprint ;
FROM: namespaces => set ;
IN: help.markup
[ "related" [ words diff ] change-word-prop ] each ;
: notify-related-words ( affected-words -- )
- [ dup associate notify-definition-observers ] each ;
+ fast-set notify-definition-observers ;
+
PRIVATE>
: related-words ( seq -- )
! (c)2009 Joe Groff bsd license
USING: accessors arrays assocs combinators.short-circuit
-compiler.units debugger init io
+compiler.units debugger init io sets
io.streams.null kernel namespaces prettyprint sequences
source-files.errors summary tools.crossref
tools.crossref.private tools.errors words ;
] with-null-writer ;
M: deprecation-observer definitions-changed
- drop keys [ word? ] filter
+ drop members [ word? ] filter
dup [ deprecated? ] any? not
[ [ check-deprecations ] each ]
[ drop initialize-deprecation-notes ] if ;
USING: accessors arrays assocs classes combinators
combinators.short-circuit compiler.units debugger fry help
help.apropos help.crossref help.home help.topics help.stylesheet
-kernel models sequences ui ui.commands ui.gadgets ui.gadgets.borders
-ui.gadgets.buttons ui.gadgets.editors ui.gadgets.glass
-ui.gadgets.labels ui.gadgets.panes ui.gadgets.scrollers
-ui.gadgets.status-bar ui.gadgets.tracks ui.gadgets.viewports
-ui.gestures ui.tools.browser.history ui.tools.browser.popups
-ui.tools.common vocabs ;
+kernel models sequences sets ui ui.commands ui.gadgets
+ui.gadgets.borders ui.gadgets.buttons ui.gadgets.editors
+ui.gadgets.glass ui.gadgets.labels ui.gadgets.panes
+ui.gadgets.scrollers ui.gadgets.status-bar ui.gadgets.tracks
+ui.gadgets.viewports ui.gestures ui.tools.browser.history
+ui.tools.browser.popups ui.tools.common vocabs ;
IN: ui.tools.browser
TUPLE: browser-gadget < tool history scroller search-field popup ;
[ call-next-method ]
} cond ;
-: showing-definition? ( defspec assoc -- ? )
+: showing-definition? ( defspec set -- ? )
{
- [ key? ]
- [ [ dup word-link? [ name>> ] when ] dip key? ]
- [ [ dup vocab-link? [ lookup-vocab ] when ] dip key? ]
+ [ in? ]
+ [ [ dup word-link? [ name>> ] when ] dip in? ]
+ [ [ dup vocab-link? [ lookup-vocab ] when ] dip in? ]
} 2|| ;
-M: browser-gadget definitions-changed ( assoc browser -- )
+M: browser-gadget definitions-changed ( set browser -- )
[ model>> value>> swap showing-definition? ] keep
'[ _ [ history-value ] keep set-history-value ] when ;
generic init kernel kernel.private math namespaces sequences
sets source-files.errors vocabs words ;
FROM: namespaces => set ;
+FROM: sets => members ;
IN: compiler.units
SYMBOL: old-definitions
SYMBOL: definition-observers
-GENERIC: definitions-changed ( assoc obj -- )
+GENERIC: definitions-changed ( set obj -- )
[ V{ } clone definition-observers set-global ]
"compiler.units" add-startup-hook
: remove-definition-observer ( obj -- )
definition-observers get remove-eq! drop ;
-: notify-definition-observers ( assoc -- )
+: notify-definition-observers ( set -- )
definition-observers get
[ definitions-changed ] with each ;
<PRIVATE
-: changed-vocabs ( assoc -- vocabs )
- [ drop word? ] assoc-filter
- [ drop vocabulary>> dup [ lookup-vocab ] when dup ] assoc-map ;
+: changed-vocabs ( set -- vocabs )
+ members [ word? ] filter
+ [ vocabulary>> dup [ lookup-vocab ] when ] map ;
-: updated-definitions ( -- assoc )
- H{ } clone
- forgotten-definitions get assoc-union!
- new-definitions get first assoc-union!
- new-definitions get second assoc-union!
- changed-definitions get assoc-union!
- maybe-changed get assoc-union!
- dup changed-vocabs assoc-union! ;
+: updated-definitions ( -- set )
+ HS{ } clone
+ forgotten-definitions get keys over adjoin-all
+ new-definitions get first keys over adjoin-all
+ new-definitions get second keys over adjoin-all
+ changed-definitions get keys over adjoin-all
+ maybe-changed get keys over adjoin-all
+ dup changed-vocabs over adjoin-all ;
: process-forgotten-definitions ( -- )
forgotten-definitions get keys
] when ;
: notify-observers ( -- )
- updated-definitions dup assoc-empty?
+ updated-definitions dup null?
[ drop ] [ notify-definition-observers notify-error-observers ] if ;
: update-existing? ( defs -- ? )
TUPLE: nesting-observer new-words ;
-M: nesting-observer definitions-changed new-words>> swap assoc-diff! drop ;
+M: nesting-observer definitions-changed
+ [ members ] dip new-words>> [ delete-at ] curry each ;
: add-nesting-observer ( -- )
new-words get nesting-observer boa
: record-top-level-form ( quot file -- )
top-level-form<<
- [ ] [ H{ } notify-definition-observers ] if-bootstrapping ;
+ [ ] [ f notify-definition-observers ] if-bootstrapping ;
: record-checksum ( lines source-file -- )
[ crc32 checksum-lines ] dip checksum<< ;
swap [ lookup-vocab ] V{ } map-as >>search-vocabs
qualified-vocabs>> [ update ] filter! drop ;
-M: manifest definitions-changed ( assoc manifest -- )
+M: manifest definitions-changed
nip update-manifest ;
PRIVATE>