home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / historic / v941.tgz / icon.v941src.tar / icon.v941src / ipl / packs / idol / strinvok.iol < prev    next >
Text File  |  2000-07-29  |  434b  |  19 lines

  1. #
  2. # a builtin class, subclasses of which support string invocation for methods
  3. # (sort of)
  4. # this is dependent upon Idol internals which are subject to change...
  5. #
  6. class strinvokable()
  7.   method eval(s,args[])
  8.     i := 1
  9.     every methodname := name(!(self.__methods)) do {
  10.     methodname[1 : find(".",methodname)+1 ] := ""
  11.     if s == methodname then {
  12.         suspend self.__methods[i] ! ([self]|||args)
  13.         fail
  14.     }
  15.     i +:= 1
  16.     }
  17.   end
  18. end
  19.