instead of parse-definition:
STARTUP-HOOK: ... ;
we parse a startup-word or a quotation:
STARTUP-HOOK: do-startup
STARTUP-HOOK: [ do-startup ]
this is somewhat experimental syntax and we might change it further
"IDENTITY-MEMO::" [ (::) define-identity-memoized ] define-core-syntax
"STARTUP-HOOK:" [
- \ ; parse-until >quotation current-vocab name>>
- add-startup-hook
+ scan-word
+ dup \ [ = [ drop parse-quotation ] [ 1quotation ] if
+ current-vocab name>> [ add-startup-hook ] 2curry append!
] define-core-syntax
"SHUTDOWN-HOOK:" [
- \ ; parse-until >quotation current-vocab name>>
- add-shutdown-hook
+ scan-word
+ dup \ [ = [ drop parse-quotation ] [ 1quotation ] if
+ current-vocab name>> [ add-shutdown-hook ] 2curry append!
] define-core-syntax
] with-compilation-unit