Questions tagged [opa]

Opa is an open source programming language for both backend and frontend web development. Opa therefore provides a unified syntax and semantics for writing all aspects of a web application: client-side, server-side and database queries. But it’s not only about expressiveness: Opa also features a unique type system that provides strong static typing from the client UI to the MongoDB queries.

Important links:

251 questions
0
votes
1 answer

Opalang and issue with the Server.start() arguments

so this Opa thing is picking up. Im starting a Server like this: function resource request_dispatch(Uri.relative p_url, p_log_fun) { //type Uri.relative = {list(string) path,…
deepblue
  • 8,426
  • 13
  • 48
  • 60
0
votes
1 answer

opa (opalang) packages and imports

so Im learning opa in my free time, and I have a question regarding packages/imports. so Im declaring a few modules, in different files package_a with module_A - in file1.opa package_a with module_B - in file1.opa package_b with module_C - in…
deepblue
  • 8,426
  • 13
  • 48
  • 60
0
votes
1 answer

Query database for an element in an List attribute of a model

I have the following data model declared: toto = { name : "toto1" tata_list : ["id1", "id2", "id3", ...] } With the OPA database query syntax, can I retrieve the "toto" model that contains a specific "id" in his "tata_list" attribute ? Something…
gogson
  • 930
  • 2
  • 8
  • 11
0
votes
1 answer

Is Opa's native database and server still available?

I tried out Opa a couple of years ago. At that time you could compile an Opa program down to a single executable that contained the server and database. Coming from a desktop application programming background, I really found this single…
aneccodeal
  • 8,531
  • 7
  • 45
  • 74
0
votes
2 answers

Opa command throws npm error, and doesn't run compiled projects

I am using Windows 7 64-bit. Whenever I try to build my projects via command prompt, using opa command it generates a .js file which, when run, thows an error, saying: module.js: 340 throw err; - and such. opa create command also throws error,…
user1548072
  • 478
  • 1
  • 6
  • 9
0
votes
1 answer

node.js error: uv_signal_start EINVA

I built the opa from source on a 32bit Debian linux(uname says it is i686) and when I issued "opa create example" on the command line I got this error message: node.js:593 throw errnoException(errno, 'uv_signal_start'); …
0
votes
1 answer

Opa: Passing Variables to Event Handlers within Iterations

To Opa Folks out there, I have been puzzled by this issue all of this past weekend. What I am trying to do in my View, is Iterate through a DBSet returned by my Model data call, generating an XHTML table of records, with each bound to a click event…
chinnychinchin
  • 5,564
  • 2
  • 21
  • 18
0
votes
1 answer

opa smtp server usage

I noticed the Opa API has a SMTPServer extension. I'm not entirely sure how this is to be used. Is what functions of email parsing built in and which have to be written in the handler? I'd appreciate a "hello world" style example for this extension.
eyecreate
  • 1,017
  • 3
  • 14
  • 26
0
votes
1 answer

How can one determine the type of a variable in opa?

I' learning the Opa (opalang.org). I am trying to find out how one can determine the type of a variable. This could be e.g. a function typeof a // in javascript, this returns the type of a The API-Documentation contains a description of…
JanD
  • 7,230
  • 3
  • 23
  • 24
0
votes
1 answer

opa database : how to know if value exists in database?

I'd like to know if a record is present in a database, using a field different from the key field. I've try the following code : function start() { jlog("start db query") myType d1 = {A:"rabbit", B:"poney"}; /myDataBase/data[A == d1.A] = d1 …
user984846
  • 263
  • 2
  • 8
0
votes
1 answer

dotcloud opa examples mongodb error

I've been trying to understand how to deploy Opa apps on dotcloud. The default app works, but the wiki example from the Opa docs fails to launch with: ==> /var/log/supervisor/opa.log <== [Opa] _no_name DbGen/Mongo/SynchroStart Db is ready [Opa]…
eyecreate
  • 1,017
  • 3
  • 14
  • 26
0
votes
1 answer

How to use modules in Opa?

OK, this is pretty basic question, but I cannot figure this out... What is the correct way to call functions from modules? The way I do it is: main.opa: function start(){ Page.page(); } Server.start( Server.http, [ {title:…
user1548072
  • 478
  • 1
  • 6
  • 9
0
votes
1 answer

What exactly is meant with 'top-level' in an Opa program?

I was browsing the source of the OpaDo program and noticed that in the module Todo a function called mypage got called. This function is declared in the file 'ui', but nowhere in the file todo.opa does the ui.opa file get imported. Is this what is…
Tails
  • 636
  • 7
  • 16
0
votes
2 answers

Is it possible to compile the src directory in a single command?

I would like to compile all the .opa files in my src directory in a single command without having to specify each file manually, or having to specify them manually in a config file. This is the parrallel issue in Java: Building Java package (javac…
Tails
  • 636
  • 7
  • 16
0
votes
1 answer

opa : binary_to_string / String.contains error

My opa application fails when I use the String.contains method on a string read from a file : import stdlib.io.file import stdlib.core function start() { txt = string_of_binary(File.content("data.txt")) jlog(txt) b =…
Guillaume
  • 289
  • 1
  • 7
1 2 3
16
17