Re: Euphoria 4.0.1
- Posted by mattlewis (admin) Mar 13, 2011
- 2592 views
Perhaps you should give us an example that doesn't work. Because it does work in general.
I started by giving the example of the function. The function only forks if you invoke the function using a sequence for quantity and same length sequence for prices. I have given three or four alternative there for quantity, commented out and the only one that will work would be a sequence for quantity.
Try the function using a single value for quantity or single value for price - IT DOES NOT WORK if you want to use a single element for quantity against multiple prices or single price for various different quantity. It is so obvious when you try it.
The statement of a single value against a sequence (as you have shown) WORKS ONLY in immediate mode - YOU CANNOT DEFINE IT AS PARAMETERS IN A FUNCTION.
And I responded with a version of the function that works like you seem to want. As I said, the problem isn't with euphoria (as far as I can tell), but with your code. If you really think that euphoria can't multiple (or add or whatever) a sequence with an atom, please give us an example that does not. You did not do that.
Your function fails elsewhere, but not at the point of multiplication. Please show me a simple example, like I did, that gives you an error when doing some arithmetic:
-- test.ex ? {{1,2}, 3, {4.5, 8.6}} * 3 <eucode> {{{ $ eui test.ex { {3,6}, 9, {13.5,25.8} } }}} Matt