Apropos my reply, this probably a good moment to ask for some advice. I had
noticed that
`see` reports a restricted USING list for individual words, not the whole
list for the file that a
word is defined in. Thinking that may be a way to reveal the minimal set of
vocabs needed for my
target vocab's USING list, I have these 3 words:

: parse-USING-lists ( string -- seq )
    R/ USING:(\s+[^;]+)+\s+;/
    all-matching-subseqs
    [ "USING:" ?head drop ";" ?tail drop
      [ blank? ] trim "\n" " " replace " " split harvest
    ] map concat  ! ( -- seq )
    members natural-sort ;

! temporary file for gathering vocab words dependencies in
`vocab-words-USES`
: lint-temp-file ( -- path )
    "resource:work/lint-temp.txt" [ touch-file ] keep ;

! calls `see`, which interestingly lists only individual word dependencies.

:: vocab-words-USES ( vocab-name! -- seq )
    vocab-name file-stem vocab-name!
    lint-temp-file utf8
    [ vocab-name vocab-words
      [ [ \ see execute( x -- ) ] each ] curry
      with-file-writer
    ] [ file-contents parse-USING-lists ] 2bi ;

But `see` reports both more and less than I expected. Executing `see` on
 `vocab-name vocab-words` (above)
may show *.private vocabs & also may not turn up some vocabs the target
source USING form properly does list.
What's the story on `see`? I work around this, but it's very curious.
~cw


On Tue, Feb 6, 2018 at 4:56 PM, CW Alston <cwalsto...@gmail.com> wrote:

> Ah, thanks for the reassurance John -
> This tells me that my own monkeying around must have caused my problem.
> I'm trying to write a linter vocab for USING: ... ; forms ( see cat's
> previous message),
> building on your neat regexp suggestion:
>
>     "resource:core/math/math.factor" utf8 file-contents
>     R/ USING:(\s+[^;]+)+\s+;/ all-matching-subseqs
>     [ "USING:" ?head drop ";" ?tail drop " " split harvest ] map concat
>
> and part of my code does a *[ ".private" tail? ] reject* in rewriting the
> USING list for the target source file.
> I likely called that on "resource:core/math/math.factor" at some stage of
> experimentation, and forgot
> to restore the original text! 🤔
> I saw this issue in testing my own work vocabs, and fixed it there, but
> didn't realize I had borked the math file earlier.
> Definitely a bad practice learning experience that I'll remember!
>
> If I get the linter working properly (& safely) I'll post a gist for
> review.
>
> ~cw
>
> On Tue, Feb 6, 2018 at 4:19 PM, John Benediktsson <mrj...@gmail.com>
> wrote:
>
>> That's weird because kernel.private has been there since March 2016
>> (6b07e6caf22b290805ddf9acedd7163165860b3c).
>>
>> I also see it in the binary releases.
>>
>> On Mon, Feb 5, 2018 at 9:08 PM, CW Alston <cwalsto...@gmail.com> wrote:
>>
>>> Hi folks -
>>> After doing a Factor git update via:
>>>
>>> cd factor
>>> ./build.sh update
>>>
>>> - At Factor startup I got:
>>>
>>> Press F1 at any time for help.
>>> Factor 0.98 x86.64 (1854, heads/master-3a23a92531, Sun Nov 26 20:04:26
>>> 2017)
>>> [Clang (GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1))] on
>>> macosx
>>>
>>> - and then pressing F2 for a refresh (no work files loaded) I got:
>>>
>>> IN: scratchpad Command: refresh-all
>>> Loading resource:core/math/math.factor ! <=======
>>> IN: scratchpad Command: continue-restart
>>> resource:core/math/math.factor:209: Note:
>>> Added "kernel.private" vocabulary to search path
>>>
>>> Restarts were invoked adding vocabularies to the search path.
>>> To avoid doing this in the future, add the following forms
>>> at the top of the source file:
>>>
>>> USING: kernel kernel.private ;
>>> IN: math
>>>
>>> IN: scratchpad
>>>
>>> - Checking the virgin "resource:core/math/math.factor" source file, I
>>> found:
>>>
>>> USING: kernel ;
>>> IN: math
>>>
>>> - After adding "kernel.private" to the source USING: list, saving,
>>> quitting, re-launching & pressing F2 for a refresh, I get no restarts:
>>>
>>> Press F1 at any time for help.
>>> Factor 0.98 x86.64 (1854, heads/master-3a23a92531, Sun Nov 26 20:04:26
>>> 2017)
>>> [Clang (GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1))] on
>>> macosx
>>>
>>> IN: scratchpad Command: refresh-all
>>> IN: scratchpad
>>>
>>> - Looks like "kernel.private" (recent change?) didn't get included in
>>> the build.
>>>
>>> Smooth sailing with work vocabs after this fix, where I had
>>> some surprising hangs before.
>>>
>>> Cheers,
>>> ~cw
>>>
>>>
>>> --
>>> *~ Memento Amori*
>>>
>>> ------------------------------------------------------------
>>> ------------------
>>> Check out the vibrant tech community on one of the world's most
>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>> _______________________________________________
>>> Factor-talk mailing list
>>> Factor-talk@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/factor-talk
>>>
>>>
>>
>
>
> --
> *~ Memento Amori*
>



-- 
*~ Memento Amori*
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to