Skip to content
Browse files

[fix] just making it compile with Opa v0.9.2

  • Loading branch information...
1 parent dad02b4 commit 463faf9f4bded6f89edfab885363f865a9d38fb3 @Aqua-Ye Aqua-Ye committed May 12, 2012
Showing with 14 additions and 12 deletions.
  1. +4 −3 Makefile
  2. +10 −9 src/example.opa
View
7 Makefile
@@ -1,16 +1,17 @@
OPA=opa
+OPAOPT=--parser classic
FILES=$(shell find src -name '*.opa')
EXE=main.exe
all: $(FILES)
- $(OPA) $^ -o main.exe
+ $(OPA) $(OPAOPT) $^ -o main.exe
-run:
+run:
./$(EXE) --db-local db/db
-new-db:
+new-db:
./$(EXE) --db-local db/db --db-force-upgrade
clean-db:
View
19 src/example.opa
@@ -1,6 +1,7 @@
import bddc.tablebuilder
+import stdlib.database.db3
/**
*
@@ -24,16 +25,16 @@ init() =
do init()
get_values() : list(vtest_k) =
- Db.intmap_fold_range(
+ Db3.intmap_fold_range(
@/test,
(acc,k -> List.add({~k v=/test[k]},acc)),
[],0,none,(_->true)
)
add(new_v : vtest) : int =
- key = Db.fresh_key(@/test)
+ key = Db3.fresh_key(@/test)
do save(key, new_v)
key
-save(key : int, new_v : vtest) =
+save(key : int, new_v : vtest) =
/test[key] <- new_v
rm(key : int) =
Db.remove(@/test[key])
@@ -50,7 +51,7 @@ rm(key : int) =
-@client
+@client
mk_columns() = [
TableBuilder.mk_column(
<>String</>,
@@ -66,7 +67,7 @@ mk_columns() = [
),
TableBuilder.mk_column(
<>Tool</>,
- (r,chan ->
+ (r,chan ->
<button onclick={_-> do TableBuilder.rm_filter(chan, (v->v.k == r.k)) rm(r.k)}>Del filter</button>
),
none,
@@ -87,7 +88,7 @@ onready() =
row_k() = {k=key() v={str=str() i=i()}}
row() = {str=str() i=i()}
// add
- onadd(_) =
+ onadd(_) =
k=add(row())
row_k={~k v=row()}
TableBuilder.add(table.channel, row_k)
@@ -99,10 +100,10 @@ onready() =
oneditkey(_) =
do save(key(), row())
TableBuilder.edit_key(table.channel, key(), row_k())
- xhtml =
+ xhtml =
<>
- str : <input id=#str/>
- int : <input id=#int />
+ str : <input id=#str/>
+ int : <input id=#int />
key : <input id=#key/>
<button onclick={onadd}>Ajouter</button>
<button onclick={ondelkey}>Del key</button>

0 comments on commit 463faf9

Please sign in to comment.
Something went wrong with that request. Please try again.