Right now fry doesn't support "frying" into sequences that aren't quotations,
so this works:
'[ [ _ ] ]
But this doesn't:
'[ { _ } ]
We have a plan to fix this as it turns out I was talking about this issue a
couple days ago with someone. I'd like to make this fix since a lot of people
hit this limitation at some point.
Best,
John.
> On May 17, 2017, at 3:37 PM, Alexander Ilin <[email protected]> wrote:
>
> Hello!
>
> I have the following code, and it works:
>
> TUPLE: resource-gadget < track res ;
>
> : find-resource-window ( resource -- world/f )
> [ { [ drop resource-gadget? ] [ res>> = ] } 2&& ] curry find-window ;
>
> Resource-gadget is a container for a resource tuple (in the res slot). The
> function is supposed to find the tuple among the gadgets.
>
> I'm trying to rewrite it to be a tad shorter, but get a compilation error:
>
> : find-resource-window ( resource -- world/f )
> '[ { [ resource-gadget? ] [ res>> _ = ] } 1&& ] find-window ;
>
> The error I'm getting is this:
>
> Stack effect declaration is wrong
> inferred ( x -- x x )
> declared ( resource -- world/f )
>
> Am I using the fried quotation incorrectly? Or am I missing something
> obvious?
>
> ---=====---
> Александр
>
> ------------------------------------------------------------------------------
> 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
> [email protected]
> 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
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk