Re: [Factor-talk] HOOK: Confusion

2018-07-28 Thread Alexander Ilin
Actually, the reasons for that may have been a little misguided. Basically, I wanted to substitute my own versions of the delete, move and copy methods with a `with-variable` scoping. So, I created a symbol that had the three (four, actually) methods defined for it, as opposed to having the infinite number of methods defined on the `windows` symbol also defined on my symbol as a redirection. You know what I mean? My special backend would record the requested file/folder operations instead of actually performing them immediately, and then it would be possible to perform those later, have the ability to see progress or cancel, etc.Or imagine you want to implement a `--dry-run` mode for your application, in which all the file operations need only to be reported to the console instead of done in the filesystem. Without separating the methods into a separate backend hook variable, if I did that with something like```my-backend io-backend [ ... ] with-variable```then `my-backend` would have to implement all kinds of crazy methods of `io-backend` like `(pipe)` or `(run-process)`, and the implementation would have to call the `windows` version of those methods, or `linux`, or whatever the previous value of `io-backend` was.I don't know of a way to subclass the `windows` symbol and only override some of its methods for the purposes of such temporary substitution. 29.07.2018, 00:06, "John Benediktsson" : Oh, so you are redefining the hook to use a different variable and it’s failing when used by another vocab? I’ll look at that later. Little busy today.  Out of curiosity why would you want it to not use the io-backend variable? On Jul 28, 2018, at 1:20 PM, Alexander Ilin  wrote: I have now pushed a branch, which adds a single commit, compared to the latest master: https://github.com/AlexIljin/factor/tree/dmc-backend(DMC stands for Delete, Move, Copy.) You can see the error I'm talking about if you:- take the branch,- start the latest build of Factor from the build farm,- press F2 in the Listener to reload the vocabs, and then- run the following command in the Listener: `USE: io.files.unique [ ] cleanup-unique-directory`. It will choke while trying to delete the temporary directory it created. I'm not sure it only chokes like that when I use my special backend. For some reason I think it sometimes fails without it, but I can't prove it (even to myself) at the moment. 28.07.2018, 01:29, "John Benediktsson" :It shouldn't fail like that, so maybe there's an issue with reloads? Do you have a simple way to reproduce it? On Fri, Jul 27, 2018 at 10:20 AM Alexander Ilin  wrote:Hello!  Sometimes I see weird errors like this:Generic word `delete-directory` does not define a method for the `word` class.Dispatching on object: `windows`  But the Browser shows that the method `delete-directory` IS defined for the `windows` symbol.  Why do the `HOOK:`s fail like this sometimes? Does it have something to do with reloading some of the involved vocabs?  ---=---Александр --
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


Re: [Factor-talk] HOOK: Confusion

2018-07-28 Thread John Benediktsson
Oh, so you are redefining the hook to use a different variable and it’s failing 
when used by another vocab? I’ll look at that later. Little busy today. 

Out of curiosity why would you want it to not use the io-backend variable?


> On Jul 28, 2018, at 1:20 PM, Alexander Ilin  wrote:
> 
> I have now pushed a branch, which adds a single commit, compared to the 
> latest master: https://github.com/AlexIljin/factor/tree/dmc-backend
> (DMC stands for Delete, Move, Copy.)
>  
> You can see the error I'm talking about if you:
> - take the branch,
> - start the latest build of Factor from the build farm,
> - press F2 in the Listener to reload the vocabs, and then
> - run the following command in the Listener: `USE: io.files.unique [ ] 
> cleanup-unique-directory`.
>  
> It will choke while trying to delete the temporary directory it created.
>  
> I'm not sure it only chokes like that when I use my special backend. For some 
> reason I think it sometimes fails without it, but I can't prove it (even to 
> myself) at the moment.
>  
> 28.07.2018, 01:29, "John Benediktsson" :
>> It shouldn't fail like that, so maybe there's an issue with reloads?
>>  
>> Do you have a simple way to reproduce it?
>>  
>> On Fri, Jul 27, 2018 at 10:20 AM Alexander Ilin  wrote:
>> Hello!
>> 
>>   Sometimes I see weird errors like this:
>> 
>> Generic word `delete-directory` does not define a method for the `word` 
>> class.
>> Dispatching on object: `windows`
>> 
>>   But the Browser shows that the method `delete-directory` IS defined for 
>> the `windows` symbol.
>>   Why do the `HOOK:`s fail like this sometimes? Does it have something to do 
>> with reloading some of the involved vocabs?
>  
>  
> ---=---
> Александр
>  
> --
> 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
--
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


Re: [Factor-talk] HOOK: Confusion

2018-07-28 Thread Alexander Ilin
I have now pushed a branch, which adds a single commit, compared to the latest master: https://github.com/AlexIljin/factor/tree/dmc-backend(DMC stands for Delete, Move, Copy.) You can see the error I'm talking about if you:- take the branch,- start the latest build of Factor from the build farm,- press F2 in the Listener to reload the vocabs, and then- run the following command in the Listener: `USE: io.files.unique [ ] cleanup-unique-directory`. It will choke while trying to delete the temporary directory it created. I'm not sure it only chokes like that when I use my special backend. For some reason I think it sometimes fails without it, but I can't prove it (even to myself) at the moment. 28.07.2018, 01:29, "John Benediktsson" :It shouldn't fail like that, so maybe there's an issue with reloads? Do you have a simple way to reproduce it? On Fri, Jul 27, 2018 at 10:20 AM Alexander Ilin  wrote:Hello!  Sometimes I see weird errors like this:Generic word `delete-directory` does not define a method for the `word` class.Dispatching on object: `windows`  But the Browser shows that the method `delete-directory` IS defined for the `windows` symbol.  Why do the `HOOK:`s fail like this sometimes? Does it have something to do with reloading some of the involved vocabs?  ---=---Александр --
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