Re: length() of an atom

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

Elements only exist in the context of a sequence. No sequence, no elements. That last 'x' is not an element.

Does an egg exist outside of its carton?

euphoric said...

Regardless, I don't think this change will hurt much, if at all. So have at it. :)

Awwww ... don't give in so soon smile

euphoric said...

But I'm curious, how does returning 1 for length(atom) make coding simpler and more user-friendly? What case did you discover works better with length(atom) returning 1?

   --- 
   r = x[1 .. i] & q & [i+1 .. $] 
   if atom(q) then 
      n += 1 
   else 
      n += length(q) 
   end if 
   --- 

but now I can code ...

   --- 
   r = x[1 .. i] & q & [i+1 .. $] 
   n += length(q) 
   --- 
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu