Skip to content

Commit

Permalink
Merge pull request #48 from nomennescio/master
Browse files Browse the repository at this point in the history
Preload useful vocabs from extra
  • Loading branch information
nomennescio authored Feb 6, 2024
2 parents b3a3c33 + 0ebee82 commit 2058344
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions codewars/imager/imager.factor
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
! Copyright (C) 2022 nomennescio
! Copyright (C) 2022-2024 nomennescio
! see LICENSE.md for license

USING: memory namespaces sequences sequences.rotated system vectors vocabs vocabs.hierarchy vocabs.loader ;
USING: kernel memory namespaces sequences sequences.rotated system vectors vocabs vocabs.hierarchy vocabs.loader ;
IN: codewars.imager

CONSTANT: preload-extra-vocabs {
"arrays" "assocs" "combinators" "coroutines" "decimals" "generators"
"grouping" "infix" "lists" "lru-cache" "math" "multisets" "pair-rocket"
"pairs" "path-finding" "qw" "sequences" "sets" "sorting" "splitting"
"trees" "variants"
}

: load-and-save-image ( -- )
"resource:pre" add-vocab-root vocab-roots [ -1 <rotated> >vector ] change-global
"resource:extra" vocab-roots get remove [ load-root ] each
"resource:extra" preload-extra-vocabs [ load-from-root ] with each
image-path save-image-and-exit
;

Expand Down

0 comments on commit 2058344

Please # to comment.