Skip to content

Commit

Permalink
Preload useful vocabs from extra (vocab list supplied and tested by K…
Browse files Browse the repository at this point in the history
…acarott <[email protected]>)
  • Loading branch information
nomennescio committed Feb 6, 2024
1 parent b3a3c33 commit 0ebee82
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 0ebee82

Please sign in to comment.