Re: Help Please with numbers

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

Jason Gade wrote:
> cklester wrote:
> > 
> > You could just provide the base functionality of summing only integers/atoms
> > in a sequence, and if the user wanted more they could wrap it themselves.
> > 
> > sumi() -- sum a list of integers
> > suma() -- sum a list of atoms
> > sum() -- sum a list of atoms and/or integers
> 
> For me, atoms and integers should be the same and should be the default case.
> If adding
> a sum() function that took strings as input, it would be the one with a
> different name
> because it is the exceptional case.

I agree that sum() should receive a sequence of numbers (that is, atoms
and/or integers),  and the user is responsible for everything else (for
example, conversion of data before/after using sum()).

-=ck
"Programming in a state of EUPHORIA."
http://www.cklester.com/euphoria/

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

Search



Quick Links

User menu

Not signed in.

Misc Menu