]> gitweb.factorcode.org Git - factor.git/commitdiff
recipes: move define-db out of a top-level form
authorJohn Benediktsson <mrjbq7@gmail.com>
Sun, 3 Sep 2023 04:29:07 +0000 (21:29 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sun, 3 Sep 2023 04:29:07 +0000 (21:29 -0700)
extra/recipes/recipes.factor

index 1722c0d1fc3c57981d86d25e3e5d05e0c972cbf0..67e2b8b3b89a9892d037a620e9d70ecbc4163d44 100644 (file)
@@ -14,7 +14,8 @@ STORED-TUPLE: recipe
 : <recipe> ( title genre text -- recipe )
     recipe new swap >>txt swap >>genre swap >>title 0 >>votes ;
 
-"recipes.db" temp-file <sqlite-db> recipe define-db
+: init-recipe-db ( -- )
+    "recipes.db" temp-file <sqlite-db> recipe define-db ;
 
 : top-recipes ( offset search -- recipes )
     <query> T{ recipe } rot >>title >>tuple
@@ -73,4 +74,4 @@ STORED-TUPLE: recipe
 
 MAIN-WINDOW: recipe-browser
     { { title "Recipes" } }
-    <recipe-gadget> >>gadgets ;
+    init-recipe-db <recipe-gadget> >>gadgets ;