1. Snippet: Length of an "object"

While working on a small project involving some text processing,
I found that the code would be simplified if the length()
function could be applied to atoms - which it can't.  The
following function, used instead of length, can be:

function len(object o)
  if atom(o) then
    return -1
  else
    return length(o)
  end if
end function

I am in the process of documenting and cleaning up my stddefs.e
collection; this will be included in the next release.
--=20
Jeff Zeitlin
jeff.zeitlin at earth.execnet.com

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu