Module operations in UI, run-module now asserts stack effect

slava 2006-10-26 05:17:40 +00:00
parent 732850bc9b
commit 41ed11abf3
4 changed files with 38 additions and 8 deletions

View File

@ -1,5 +1,4 @@
- live search: timer delay would be nice - live search: timer delay would be nice
- hashed generic method dispatch
- fix this: - fix this:
[ 1 2 3 4 5 6 7 8 9 10 10 10 10 10 10 10 10 10 10 11 11 11 113 ] . [ 1 2 3 4 5 6 7 8 9 10 10 10 10 10 10 10 10 10 10 11 11 11 113 ] .
[ 1 2 3 4 5 6 7 8 9 10 10 10 10 10 10 10 10 10 10 11 11 11 113 [ 1 2 3 4 5 6 7 8 9 10 10 10 10 10 10 10 10 10 10 11 11 11 113
@ -71,6 +70,7 @@
- incremental GC - incremental GC
- UDP - UDP
- slice: if sequence or seq start is changed, abstraction violation - slice: if sequence or seq start is changed, abstraction violation
- hashed generic method dispatch
+ httpd: + httpd:

View File

@ -61,13 +61,13 @@ C: module ( name files tests help -- module )
: all-modules ( -- seq ) modules get 1 <column> ; : all-modules ( -- seq ) modules get 1 <column> ;
: all-module-names ( -- seq ) modules get 0 <column> ;
: test-modules ( -- ) : test-modules ( -- )
all-modules [ module-tests ] map concat run-tests ; all-modules [ module-tests ] map concat run-tests ;
: modules. ( -- ) : modules. ( -- )
all-module-names natural-sort [ print ] each ; all-modules
[ [ module-name ] 2apply <=> ] sort
[ [ module-name ] keep write-object terpri ] each ;
: reload-module ( module -- ) : reload-module ( module -- )
dup module-name module-def source-modified? [ dup module-name module-def source-modified? [
@ -82,7 +82,7 @@ C: module ( name files tests help -- module )
: run-module ( name -- ) : run-module ( name -- )
dup require dup require
dup module module-main [ dup module module-main [
call assert-depth
] [ ] [
"The module " write write "The module " write write
" does not define an entry point." print " does not define an entry point." print

View File

@ -9,7 +9,7 @@ TUPLE: help-gadget pane history search ;
: show-help ( link help -- ) : show-help ( link help -- )
dup help-gadget-history add-history dup help-gadget-history add-history
help-gadget-history set-model ; >r >link r> help-gadget-history set-model ;
: go-home ( help -- ) "handbook" swap show-help ; : go-home ( help -- ) "handbook" swap show-help ;
@ -17,7 +17,7 @@ TUPLE: help-gadget pane history search ;
gadget get help-gadget-history [ help ] <pane-control> ; gadget get help-gadget-history [ help ] <pane-control> ;
: init-history ( help-gadget -- ) : init-history ( help-gadget -- )
T{ link f "handbook" } <history> "handbook" <history>
swap set-help-gadget-history ; swap set-help-gadget-history ;
C: help-gadget ( -- gadget ) C: help-gadget ( -- gadget )

View File

@ -5,7 +5,7 @@ USING: definitions gadgets gadgets-browser gadgets-dataflow
gadgets-help gadgets-listener gadgets-text gadgets-workspace gadgets-help gadgets-listener gadgets-text gadgets-workspace
hashtables help inference kernel namespaces parser prettyprint hashtables help inference kernel namespaces parser prettyprint
scratchpad sequences strings styles syntax test tools words scratchpad sequences strings styles syntax test tools words
generic models io ; generic models io modules ;
V{ } clone operations set-global V{ } clone operations set-global
@ -96,6 +96,13 @@ M: operation invoke-command ( target operation -- )
{ +listener+ t } { +listener+ t }
} define-operation } define-operation
[ word? ] H{
{ +default+ t }
{ +name+ "Forget" }
{ +keyboard+ T{ key-down f { A+ } "b" } }
{ +quot+ [ forget ] }
} define-operation
[ word? ] H{ [ word? ] H{
{ +name+ "Word dataflow" } { +name+ "Word dataflow" }
{ +keyboard+ T{ key-down f { A+ } "d" } } { +keyboard+ T{ key-down f { A+ } "d" } }
@ -119,6 +126,29 @@ M: operation invoke-command ( target operation -- )
{ +quot+ [ vocab-link-name [ use+ ] curry call-listener ] } { +quot+ [ vocab-link-name [ use+ ] curry call-listener ] }
} define-operation } define-operation
[ vocab-link? ] H{
{ +name+ "Forget" }
{ +quot+ [ vocab-link-name forget-vocab ] }
} define-operation
! Module
[ module? ] H{
{ +name+ "Run" }
{ +quot+ [ module-name run-module ] }
{ +listener+ t }
} define-operation
[ module? ] H{
{ +name+ "Documentation" }
{ +quot+ [ module-help [ help-gadget call-tool ] when* ] }
} define-operation
[ module? ] H{
{ +name+ "Reload" }
{ +quot+ [ reload-module ] }
{ +listener+ t }
} define-operation
! Link ! Link
[ link? ] H{ [ link? ] H{
{ +default+ t } { +default+ t }