SYMBOLS: large xtra huge massive ;
You can case off these:
: fill-drink ( drink size -- )
{
{ large [ .3 fill-it ] }
...
} case ;
This way there are no Funny numbers to deal with, just symbols.
For method dispatch, make singletons instead.
Doug
Sent from my iPhone
On Sep 10, 2009, at 8:30 PM, "Hugh Aguilar" <[email protected]>
wrote:
> Thanks for the help regarding clone; I'll work through it.
>
> Another question I have is regarding enum. I didn't understand the
> docs on
> this. This is the code that I have right now:
>
> : inf 4 ; ! this size isn't supported; it is just used
> as a
> place-marker
> : big 3 ; ! this is our super-size
> : mid 2 ;
> : sml 1 ;
> : tny 0 ; ! this is our itty-bitty
>
> : mark-sizes { .05 .10 .15 .20 } ; ! these sizes correspond
> to tny,
> sml, mid and big
>
> Is there a more elegant way to do this? The numbers have to be as I
> have
> them because they are used as indices into mark-sizes. Sometimes I
> write
> code like this though, and the numbers are just arbitrary as I am
> only using
> them in IF and CASE statements.
>
>> ---
>> -------------------------------------------------------------------
>>
>> Message: 1
>> Date: Wed, 9 Sep 2009 16:42:27 -0500
>> From: Slava Pestov <[email protected]>
>> Subject: Re: [Factor-talk] clone confusion
>> To: [email protected]
>> Message-ID:
>> <[email protected]>
>> Content-Type: text/plain; charset=ISO-8859-1
>>
>> On Wed, Sep 9, 2009 at 3:38 PM, Hugh
>> Aguilar<[email protected]>
>> wrote:
>>> The problem
>>> is that I want the nodes in the new linked list to be of some
>>> child type
>>> rather than the parent type of the nodes in the source linked-list.
>>
>> Sounds like you want to write a 'map' combinator that operates on
>> your
>> list type.
>
>
> ---
> ---
> ---
> ---------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> 30-Day
> trial. Simplify your report design, integration and deployment - and
> focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Factor-talk mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/factor-talk
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk