]> gitweb.factorcode.org Git - factor.git/commitdiff
syntax: Add REUSE: word to easily USE: but reload.
authorDoug Coleman <doug.coleman@gmail.com>
Tue, 21 Dec 2021 21:27:18 +0000 (15:27 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Tue, 21 Dec 2021 21:27:18 +0000 (15:27 -0600)
My use case is specifically for load-all with editors. The last
editor on macOS is Xcode and I use vscode, and once you have
``USE: editors.visual-studio-code`` then the next time it's a no-op.

``REUSE: editors.visual-studio-code`` is the same thing but with
two extra characters, as opposed to ``"editors.visual-studio-code" reload``
which requires a lot more typing.

We could have ``EDIT:``, ``EDIT-DOCS:``, ``EDIT-TESTS:`` etc if this REUSE:
word is successful.

core/bootstrap/syntax.factor
core/syntax/syntax.factor
misc/fuel/factor-mode.el

index 60d573b43a21e27a2f3cb88a4e9250dd7cc5fab6..302bf7a0caa48791be441cfb8f1bdb86a4033ead 100644 (file)
@@ -51,6 +51,7 @@ IN: bootstrap.syntax
         "T{"
         "UNION:"
         "INTERSECTION:"
+        "REUSE:"
         "USE:"
         "UNUSE:"
         "USING:"
index 7a181425b2b2a0797c333afb38048fc436d1b501..ee56d0ac9d9134d9ab3e838db7caa634ae2224ba 100644 (file)
@@ -10,8 +10,8 @@ generic.math generic.parser generic.standard hash-sets
 hashtables hashtables.identity io.pathnames kernel lexer
 locals.errors locals.parser macros math memoize namespaces
 parser quotations sbufs sequences slots source-files splitting
-strings strings.parser vectors vocabs.parser words words.alias
-words.constant words.symbol ;
+strings strings.parser vectors vocabs.loader vocabs.parser words
+words.alias words.constant words.symbol ;
 IN: bootstrap.syntax
 
 ! These words are defined as a top-level form, instead of with
@@ -47,6 +47,8 @@ IN: bootstrap.syntax
 
     "PRIVATE>" [ end-private ] define-core-syntax
 
+    "REUSE:" [ scan-token reload ] define-core-syntax
+
     "USE:" [ scan-token use-vocab ] define-core-syntax
 
     "UNUSE:" [ scan-token unuse-vocab ] define-core-syntax
index 4b135788f0452593561de8b78aa0de1385ce88f2..c2d64ff2f50d50581fe1ae717ae60b6b175dec63 100644 (file)
@@ -355,7 +355,7 @@ these lines in your .emacs:
                 "RENAME:"
                 "SINGLETON:" "SLOT:" "SPECIALIZED-ARRAY:"
                 "TYPEDEF:"
-                "USE:")))
+                "REUSE:" "USE:")))
 
 (defconst factor-begin-of-def-regex
   (format "^USING: \\|\\(%s\\)\\|\\(^%s .*\\)"