Re: Euphoria 4.0.1

new topic     » goto parent     » topic index » view thread      » older message » newer message
Vinoba said...

The function fails unless you put in a sequence on each side of the multiplication.

You are wrong. Consider, for example:

? {1, 2, 3, 4 } * 2  -- prints {2,4,6,8} 
Vinoba said...

This is not the end of the story. In modern software writing this action might only be a small part of much larger application, and yet this simple function I wrote will not work unless both sides of the multiplication are sequences. In other words, you can't buy a dozen each of oranges, apples, and peaches at different prices and expect the invoice to work unless you put the quantity 12 three times, - My question is why has this weakness been allowed to stay?

I think the weakness is with your code. I gave you a version that would work with the quantity as an atom. And above, I gave a very simple example of multiplying a sequence and an atom.

Vinoba said...

It is not that I cannot write a more involved function allowing for these different values - the concern is at the lower level, being why does euphoria claim that a multiplication will work between a sequence and a single value and yet the implementation of it is not easy to say the least.

Perhaps you should give us an example that doesn't work. Because it does work in general.

Matt

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu