Skip to content

Commit

Permalink
misc changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ochafik committed Feb 23, 2014
1 parent d918a11 commit 53dab88
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
17 changes: 15 additions & 2 deletions CasbahDSL/src/test/scala/test.scala
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,22 @@ class QueryTest {
query(d => d.foo < "bar" || d.foo.size == 4))
}

@Ignore
@Ignore
@Test
def testConnection {
val client = MongoClient()
// val client = MongoClient()

def makeEntry(word: String) =
$set ( (word + "_").iterator.mkString(".") -> word )

val dict = MongoConnection("localhost")("appdb")("dict")
val index = MongoDBObject("_id" -> "_index")
dict.update(index, makeEntry("applaud"), true, false)
dict.update(index, makeEntry("apple"), true, false)
dict.update(index, makeEntry("bad"), true, false)
dict.update(index, makeEntry("banana"), true, false)

val entry = dict.findOne(index ++ ("a.p.p" $exists true))
println(entry)
}
}
9 changes: 5 additions & 4 deletions Experiments/JS/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,20 @@ Still very early experimentation, but the goal is to make Scala a first-class ci

Here are the current design goals / constraints:

- Calls from Scala to JavaScript should be very easy:
- Possibility to write inline JS with some string interpolation (+ translation of JS errors back to Scala ones)
- Full signatures of JavaScript externs to allow Scala typer to show its magic (using closure externs)
- *Dynamic* mode where everything is allowed (`obj.asDynamic.whatever = blah`)
- The generated JavaScript code should:
- Be human-readable,
- Be obvious how to interface with from JavaScript,
- Have full Closure type annotations
- Be about as small as if it had been written by hand, and not have too many libraries
- The compiler should:
- Be as fast as possible (resident compiler + sbt-style build manager?)
- Provide a separate compilation model (+ linking = closure pass)
- Support optional optimized mode
- Output source maps to allow debugging of Scala sources from the browser
- Calls from Scala to JavaScript should be very easy:
- Possibility to write inline JS with some string interpolation (+ translation of JS errors back to Scala ones)
- Full signatures of JavaScript externs to allow Scala typer to show its magic (using closure externs)
- *Dynamic* mode where everything is allowed (`obj.asDynamic.whatever = blah`)

# Example

Expand Down
2 changes: 1 addition & 1 deletion Experiments/JS/project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ resolvers ++= Seq(
Opts.resolver.sonatypeReleases
)

addSbtPlugin("org.ensime" % "ensime-sbt-cmd" % "0.1.1")
addSbtPlugin("org.ensime" % "ensime-sbt-cmd" % "0.1.2")

0 comments on commit 53dab88

Please sign in to comment.