Hello!

  I'm developing my chart gadget. I want to achieve this:

ALIAS: x first
ALIAS: y second

: chart-axes ( chart -- seq )
    [ dim>> ] [ axes>> ] bi [
        nip
    ] [
        [ 0 swap 2array ] map
    ] if* ;


M: axis draw-gadget*
    dup parent>> dup chart? [| axis chart |
        axis vertical?>> :> vert?
        chart dim>> :> dim
        dim chart chart-axes vert? [ [ x ] bi@ ] [ [ y ] bi@ ] if
        ! etc...
    ] [ 2drop ] if ;

  I thought I found a clever way to simplify that `if` there:

        dim chart chart-axes vert? [ x ] [ y ] ? bi@

  But the compiler says that I can't use `call` on runtime-computed quotations. 
Is there a way to work around that, like, by using a MACRO: or something?

  Or is this a hard limitation on the available abstraction of the computation?

  Basically, depending on a boolean flag I need to either take the first or the 
second element of the two arrays on the stack, and place the taken elements on 
the stack in the same order.

---=====--- 
 Александр

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