Loading ...
Sorry, an error occurred while loading the content.

[Io] Re: Dot(s), Identifier or Operator?

Expand Messages
  • Jon Kleiser
    ... To an overview over which operators are defined by which prototypes, I wrote this little script: operMap := Map clone IoVM slotNames foreach(isn,
    Message 1 of 6 , May 1, 2006
    View Source
    • 0 Attachment
      --- In iolanguage@yahoogroups.com, Quag <quaggy@...> wrote:
      >
      > Hi Jon,
      >
      > On 4/29/06, Jon Kleiser <jon.kleiser@...> wrote:
      > > --- In iolanguage@yahoogroups.com, Jon Kleiser
      > > <jon.kleiser@> wrote:
      > > >
      > > > Looking at the IoOpTable ops[] list in the file IoToken_parser.c, one
      > > > may think that the single "." may be used as an Operator in some
      > > > settings, but I can't recall where that may be.
      > >
      > > Does Io currently use the single "." as an Operator in any
      > > setting? (If not, I think it should be removed from the IoOpTable.)
      >
      > The op table is completely misleading. I haven't fixed it yet, because
      > both the parser and the lexer use the op table. I have now changed how
      > the parser uses it, but I haven't cleaned up the lexer yet.
      >
      > I will clean the op table at some point.
      >
      > Jonathan.

      To an overview over which operators are defined by which prototypes, I wrote this little
      script:

      operMap := Map clone

      IoVM slotNames foreach(isn,
      getSlot(isn) slotNames foreach(sn,
      t := getSlot(isn) getSlot(sn) type
      if ((t == "Block") or (t == "CFunction"),
      if ((sn size > 0) and (sn at(0) isLetter not),
      pList := operMap at(sn)
      if (pList == nil,
      pList = list()
      operMap atPut(sn, pList)
      )
      pList append(isn)
      )
      )
      )
      )
      operMap keys sort foreach(sn, writeln(sn, "\t", operMap at(sn)))

      Operators with alpha-names ('and', 'or') are not included.

      /Jon
    Your message has been successfully submitted and would be delivered to recipients shortly.