Hi,

SYMBOL: buy
SYMBOL: sell
...

TUPLE: market ;
TUPLE: limit price ;
TUPLE: stop price ;

Something like that? Then you can dispatch on 'exec method'.

Slava

Joel Reymont wrote:
> Suppose I have the following chunk of OCaml AST:
>
> and order_type =
>      | Buy
>      | Sell
>      | Short
>      | Cover
>
> and exec_method =
>      | Market
>      | Limit of price
>      | Stop of price
>
> and shares =
>      | All
>      | Qty of expr
>      | Total of expr
>
> What is the best way to convert this to Factor?
>
> Do I define a tuple for the ast, then a shares tuple, tuples for all- 
> shares, qty-shares, total-shares and then have UNION: shares all- 
> shares qty-shares total-shares?
>
> Is this the best approach?
>
> I have pretty-printing and conversion code that takes different  
> actions depending on the type of shares it deals with, for example.
>
>       Thanks, Joel
>
> --
> http://wagerlabs.com
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Factor-talk mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
>   


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to