views:

98

answers:

3

Im reading http://debasishg.blogspot.com/2008/04/external-dsls-made-easy-with-scala.html and I am trying to find info on the "<~" operator, for example:

def trans = "(" ~> repsep(trans_spec, ",") <~ ")"

I have some reasonable guess that has something to do with the product("~") operator along with lists?

  1. What does it do?
  2. In the future, how do I lookup operators like that? It is no good to google "<~" for example.

EDIT:

Found the "<~" info in http://stackoverflow.com/questions/256694/scala-combinator-parsers-distinguish-between-number-strings-and-variable-string

Question 2 remains

+5  A: 

On Question 2, unfortunately that is one disadvantage of Scala's allowance of non-alphabetic characters, they're not easily found in search engines. Your best bet is simply to check the Scaladocs of whatever code is in scope.

pr1001
+5  A: 

This link could be useful:

http://jim-mcbeath.blogspot.com/2008/12/scala-operator-cheat-sheet.html

Landei
The cross reference to scala api seems broken unfortunately :(
svrist
Yes, but the API on scala-lang seems to be not longer "linkeable", as all you get is http://www.scala-lang.org/docu/files/api/index.html (regardless of the class you browse to). But you can replace the first part of the URL by https://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/library which goes to their Trac
Landei
+3  A: 

Regarding Question 2, there is an upcoming (time-frame unkonwn to me) addition to the ScalaDoc processor that will produce a cross-reference index that allows you to look up method and field names and see which classes declare or define them.

You can get a preview of this (not integrated with the ScalaDocs, but useful nonetheless) here: ScalaDoc Name Index

Randall Schulz