I think the key is to use the nth word instead of first and second.
Then do it like this:

  { "a" 2 3 } { "b" 5 6 } 2 random 0 = 0 1 ? rot over [ swap nth ] 2bi@

In your code it would be:

  dim chart chart-axes vert? 0 1 ? rot over [ swap nth ] 2bi@

Or

  dim chart chart-axes vert? 0 1 ? [ swap nth ] keep rot nth

Or even:

  dim chart chart-axes vert? 0 1 ? '[ _ swap nth ] bi@


2017-02-04 2:31 GMT+01:00 Alexander Ilin <ajs...@yandex.ru>:
> That's great!
>
>   I did this:
>
> : ?[x/y] ( ? -- quot )
>     [ x ] [ y ] ? [ call( a -- b ) ] curry ; inline
>
> ...
>         dim chart chart-axes vert? ?[x/y] bi@
>
> 04.02.2017, 04:29, "John Benediktsson" <mrj...@gmail.com>:
>> Well I'm not sure about the compiler effect declaration, but you could do 
>> this:
>>
>> vert? [ x ] [ y ] ? [ call( a -- b ) ] curry
>>
>>>  On Feb 3, 2017, at 5:04 PM, Alexander Ilin <ajs...@yandex.ru> wrote:
>>>
>>>  vert? [ x ] [ y ] ? check-effect( a -- b )
>>
>> ------------------------------------------------------------------------------
>> 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



-- 
mvh/best regards Björn Lindqvist

------------------------------------------------------------------------------
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