mod_ocaml 0.01
Sponsored Links
mod_ocaml 0.01 Ranking & Summary
File size:
0.016 MB
Platform:
Any Platform
License:
GPL (GNU General Public License)
Price:
Downloads:
1632
Date added:
2005-05-05
Publisher:
Leo Fellermayr
mod_ocaml 0.01 description
Generally, mod_ocaml is a flexible module for use with the famous Apache Web Server. Probably you know how to benefit of other modules with unbelievable capabilities, like PHP (mod_php4) or Perl (mod_perl).
One of the advantages of the Apache Server is the possibility to extend its features by adding modules to your configuration. At this point, mod_ocaml comes up.
mod_ocaml is designed to work with the 1.3 family of Apaches all over the world.
OCAML is derived from the CAML language. We include the description from its home at INRIA here:
Caml is a programming language, easy to learn, easy to use, and yet amazingly powerful.
It is developed and distributed by INRIA (the main French research institute for computer science), since 1984. It is freely available for Unix, PC or Macintosh.
Objective Caml (OCAML) is a general purpose programming language that combines
functional, imperative, and object-oriented programming. The language is statically typed; its type system ensures the correct evaluation of programs.
Types are automatically inferred. The language offers powerful constructions such as user-definable data-types, the ability to define functions by pattern-matching, and an exception mechanism. Programming in the large is facilitated by a full-fledge class-based object-oriented layer and an expressive module system.
Installation
Find your installed apxs, usually in /usr/bin, or /usr/local/apache/bin.
Call apxs -c mod_ocaml.c to compile the module
Copy the created file mod_ocaml.so to your apache libexec directory, e. g. /usr/local/apache/libexec.
Make two entries in your httpd.conf configuration file:
LoadModule mod_ocaml mod_ocaml.so
AddHandler ocaml-parsed .ocml
Restart your apache web server. Now it is ready to process your OCML-files.
Usage
You simply write poor old HTML code and save it under your webserver root. Choose the extension you entered at the "AddHandler" directive in httpd.conf (per default, this is .ocml). So you save a file named, e. g. test.ocml.
Until now, you didnt use any of the mod_ocaml benefits. Try to include OCAML code, and it will be displayed "as is". Since you want your OCAML code to be interpreted and evaluated, you have to inform mod_ocaml of this:
< ?ocml
Printf.printf ("This is generated by the OCAML interpreter.");;
? >
As you can see, the init tag for your OCAML parts is "". As said before: It is much like PHP, but its OCAML with all its advantages and possibilities of functional and imperative programming. Everything that is located on the outside of these OCAML blocks will be displayed "as is".
This solution makes it also possible to include HTML code within a loop statement like "while" or "for", e. g. when outputting big HTML tables with many cells and columns. But dont forget about the functional focus of OCAML when using things like that ;-)
Interoperability
Sure. You want to process GET requests within your mod_ocaml pages. You call your pages like http://www.some.where/mypage.ocml?a=foo&b=bar. After that, you have two variables a and b which are fully available to your OCAML code. Just include them with $a and $b, like this:
Printf.printf ("$n");;
Please note: YOU (as web developer, programmer, ...) are responsible for proper implementing these external vars, e. g. including in quotation for strings, etc. Also take care of input checking if youre expecting lists and other cool data types from the "outside"
We didnt want to check this external input. Not because we were too lazy, but you shall have all the possibilities to do with mod_ocaml what YOU want. Additionally, OCAML is a typed language and you just have to pay attention to what you are doing. When we set up the concept of mod_ocaml, we didnt want to destroy this intention.
One of the advantages of the Apache Server is the possibility to extend its features by adding modules to your configuration. At this point, mod_ocaml comes up.
mod_ocaml is designed to work with the 1.3 family of Apaches all over the world.
OCAML is derived from the CAML language. We include the description from its home at INRIA here:
Caml is a programming language, easy to learn, easy to use, and yet amazingly powerful.
It is developed and distributed by INRIA (the main French research institute for computer science), since 1984. It is freely available for Unix, PC or Macintosh.
Objective Caml (OCAML) is a general purpose programming language that combines
functional, imperative, and object-oriented programming. The language is statically typed; its type system ensures the correct evaluation of programs.
Types are automatically inferred. The language offers powerful constructions such as user-definable data-types, the ability to define functions by pattern-matching, and an exception mechanism. Programming in the large is facilitated by a full-fledge class-based object-oriented layer and an expressive module system.
Installation
Find your installed apxs, usually in /usr/bin, or /usr/local/apache/bin.
Call apxs -c mod_ocaml.c to compile the module
Copy the created file mod_ocaml.so to your apache libexec directory, e. g. /usr/local/apache/libexec.
Make two entries in your httpd.conf configuration file:
LoadModule mod_ocaml mod_ocaml.so
AddHandler ocaml-parsed .ocml
Restart your apache web server. Now it is ready to process your OCML-files.
Usage
You simply write poor old HTML code and save it under your webserver root. Choose the extension you entered at the "AddHandler" directive in httpd.conf (per default, this is .ocml). So you save a file named, e. g. test.ocml.
Until now, you didnt use any of the mod_ocaml benefits. Try to include OCAML code, and it will be displayed "as is". Since you want your OCAML code to be interpreted and evaluated, you have to inform mod_ocaml of this:
< ?ocml
Printf.printf ("This is generated by the OCAML interpreter.");;
? >
As you can see, the init tag for your OCAML parts is "". As said before: It is much like PHP, but its OCAML with all its advantages and possibilities of functional and imperative programming. Everything that is located on the outside of these OCAML blocks will be displayed "as is".
This solution makes it also possible to include HTML code within a loop statement like "while" or "for", e. g. when outputting big HTML tables with many cells and columns. But dont forget about the functional focus of OCAML when using things like that ;-)
Interoperability
Sure. You want to process GET requests within your mod_ocaml pages. You call your pages like http://www.some.where/mypage.ocml?a=foo&b=bar. After that, you have two variables a and b which are fully available to your OCAML code. Just include them with $a and $b, like this:
Printf.printf ("$n");;
Please note: YOU (as web developer, programmer, ...) are responsible for proper implementing these external vars, e. g. including in quotation for strings, etc. Also take care of input checking if youre expecting lists and other cool data types from the "outside"
We didnt want to check this external input. Not because we were too lazy, but you shall have all the possibilities to do with mod_ocaml what YOU want. Additionally, OCAML is a typed language and you just have to pay attention to what you are doing. When we set up the concept of mod_ocaml, we didnt want to destroy this intention.
mod_ocaml 0.01 Screenshot
mod_ocaml 0.01 Keywords
Bookmark mod_ocaml 0.01
mod_ocaml 0.01 Copyright
WareSeeker periodically updates pricing and software information of mod_ocaml 0.01 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of mod_ocaml 0.01 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
modular homes
language of flowers
ocaml programming language
hardest language to learn
language arts lesson plans
language translation
ocaml tutorial
language of pakistan
reading body language and lying
apache gold casino
ocamlc
body language
language fail
language translator
ski apache
language tools
ocaml list
apache county
Related Software
mod_corba is an exposes Apache module API via CORBA. Free Download
mod_uno is an Apache module for UNO C++ Servlets. Free Download
Mod_auth_vpopmail is an Apache module if to authenticate against vpopmail db system. Free Download
mod_dnsbl is an Apache module for content filtering based on DNS blacklists. Free Download
mod_choke is a module for Apache that limits usage by greedy clients. Free Download
mod_dbi_pool provides database connection pooling services for other Apache Modules. Free Download
mod_streamav is an Apache 2 filter that scans the content of the Apache Brigades using the Clamav virus scanning engine. Free Download
mod_proxy_add_uri adds X-Original-URI header to outgoing proxy requests. Free Download
Latest Software
Popular Software
Favourite Software