Re: Euphoria 4.0.1
- Posted by Vinoba Mar 13, 2011
- 2592 views
-- test.ex ? {{1,2}, 3, {4.5, 8.6}} * 3 <eucode> {{{ $ eui test.ex { {3,6}, 9, {13.5,25.8} } }}} Matt
Tiny little samples is not what I am talking about. In my original function I would introduce discounts sometimes the discounts are blanket discount (Like you see in stores as "10% off every Tuesday") therefore that day and only on that day there will be a single value in a third parameter called sdiscount. On other days there would be individual discounts so there would be a sequence of same length for discounts. Then a customer would come in and buy several items where there is no discount and one item where there is a discount. All this has to accommodate with in loop - you cannot use a blanket statement in every instance (sitemcost = squantiy * (sprice - (sprice * sdiscount)) - you have to define loops because the input may be a sequence (in a majority of cases) but off and and the discount would be one value for all items in the purchased list. Again there may be an individual discount on some items and then as you are walking along the aisle you will see "all tiles extra 5% off today". Then you have a problem of the sequence you are using. so ultimately the function WILL HAVE TO CONTAIN A LOOP.
i regret you have not been able to see the imbalance in what euphoria says (quite rightly) about single value against a sequence and its actual us fullness or rather the difficulty of use in real life writing of functions where one is faced with having to use loops to separate out action on each item of the sequence.