2009/10/30 Fred Janon <fja...@gmail.com>:
> The examples use the compiler, I guess.
Every example uses the flapjax.js, right. But it's possible and
absolutely okay to use it without the compiler.
> The paper refers to using the
> library without the compiler. so what do I need to use to an HTML page
> to use the library only and not anything that deals with the compiler?
> I am guessing just include the js library in the HTML head? Do I still
> need to use "text/flapjax" around my code or just "text/javascript"
> tags?
You should do something like the following:
<!DOCTYPE html>
<html>
<head>
<title>test page</title>
<script type="text/javascript" src="flapjax.js"></script>
<script type="text/javascript">
function loader() {
// your code goes here
}
</script>
<head>
<body onload="loader()">
<p>hello, world</p>
</body>
</html>
Go to www.flapjax-lang.org/docs/ and see if that makes any sense.
The language in which function contracts are written (e.g.,
EventStream 'a -> Behavior 'a) can seem tricky and unnecessary at
first, but you'll realize its usefulness eventually.
You can also browse the list archives, there are a few demos around.
> Would the HTML pages then work without any Web connection? Or
> does the library still calls home?
Flapjax is geared towards fat clients (i.e., applications that perform
most of their work client-side). But anyway, an answer to your
question very much depends on a specific application.
Cheers,
Artyom Shalkhakov.
(We can thus see what the compiler actually does, at least partly.)
On the other hand, when Flapjax works as a library of JavaScript, one
just writes JavaScript and must explicitly call functions like liftB
to invoke the magic...
Pan, Xingzhi
http://www.panxingzhi.net
This is correct.
Arjun