Skip to content
This repository
Browse code

Update readme.txt to readme.md for better formatting.

  • Loading branch information...
commit 204ab53afca25a1d2f2e42c112a1b8b325e9cf5d 1 parent 8f72260
Jason Turner authored August 14, 2012

Showing 2 changed files with 82 additions and 55 deletions. Show diff stats Hide diff stats

  1. 82  readme.md
  2. 55  readme.txt
82  readme.md
Source Rendered
... ...
@@ -0,0 +1,82 @@
  1
+ChaiScript
  2
+
  3
+http://www.chaiscript.com
  4
+
  5
+(c) 2009-2012 Jason Turner and Jonathan Turner
  6
+
  7
+Release under the BSD license, see "license.txt" for details.
  8
+
  9
+Introduction
  10
+============
  11
+
  12
+ChaiScript is one of the only embedded scripting language designed from the 
  13
+ground up to directly target C++ and take advantage of modern C++ development 
  14
+techniques, working with the developer like he expects it to work.  Being a 
  15
+native C++ application, it has some advantages over existing embedded scripting 
  16
+languages:
  17
+
  18
+1) It uses a header-only approach, which makes it easy to integrate with 
  19
+   existing projects.
  20
+2) It maintains type safety between your C++ application and the user scripts.
  21
+3) It supports a variety of C++ techniques including callbacks, overloaded 
  22
+   functions, class methods, and stl containers.
  23
+
  24
+Requirements
  25
+============
  26
+
  27
+ChaiScript requires a recent version of Boost (http://www.boost.org) to build.
  28
+
  29
+Usage
  30
+=====
  31
+
  32
+* Add the ChaiScript include directory to your project's header search path
  33
+* Add `#include <chaiscript/chaiscript.hpp>` to your source file
  34
+* Instantiate the ChaiScript engine in your application.  For example, create 
  35
+  a new engine with the name `chai` like so: `chaiscript::ChaiScript chai`
  36
+
  37
+Once instantiated, the engine is ready to start running ChaiScript source.  You 
  38
+have two main options for processing ChaiScript source: a line at a time using 
  39
+`chai.eval(string)` and a file at a time using `chai.eval_file(fname)`
  40
+
  41
+To make functions in your C++ code visible to scripts, they must be registered 
  42
+with the scripting engine.  To do so, call add:
  43
+
  44
+    chai.add(chaiscript::fun(&my_function), "my_function_name");
  45
+
  46
+Once registered the function will be visible to scripts as "my_function_name"
  47
+
  48
+Examples
  49
+========
  50
+
  51
+ChaiScript is similar to ECMAScript (aka JavaScript(tm)), but with some 
  52
+modifications to make it easier to use.  For usage examples see the "samples" 
  53
+directory, and for more in-depth look at the language, the unit tests in the 
  54
+"unittests" directory cover the most ground.
  55
+
  56
+For examples of how to register parts of your C++ application, see 
  57
+"example.cpp" in the "src" directory. Example.cpp is verbose and shows every 
  58
+possible way of working with the library. For further documentation generate 
  59
+the doxygen documentation in the build folder or see the website 
  60
+http://www.chaiscript.com.
  61
+
  62
+
  63
+The shortest complete example possible follows:
  64
+
  65
+    /// main.cpp
  66
+
  67
+    #include <chaiscript/chaiscript.hpp>
  68
+
  69
+    double function(int i, double j)
  70
+    {
  71
+      return i * j;
  72
+    }
  73
+
  74
+    int main()
  75
+    {
  76
+      chaiscript::ChaiScript chai;
  77
+      chai.add(chaiscript::fun(&function), "function");
  78
+
  79
+      double d = chai.eval<double>("function(3, 4.75);");
  80
+    }
  81
+
  82
+
55  readme.txt
... ...
@@ -1,55 +0,0 @@
1  
-ChaiScript
2  
-http://www.chaiscript.com
3  
-(c) 2009-2012 Jason Turner and Jonathan Turner
4  
-Release under the BSD license, see "license.txt" for details.
5  
-
6  
-[Introduction]
7  
-
8  
-ChaiScript is one of the only embedded scripting language designed from the ground up to directly target C++ and take advantage of modern C++ development techniques, working with the developer like he expects it to work.  Being a native C++ application, it has some advantages over existing embedded scripting languages:
9  
-
10  
-1) It uses a header-only approach, which makes it easy to integrate with existing projects.
11  
-2) It maintains type safety between your C++ application and the user scripts.
12  
-3) It supports a variety of C++ techniques including callbacks, overloaded functions, class methods, and stl containers.
13  
-
14  
-[Requirements]
15  
-
16  
-ChaiScript requires a recent version of Boost (http://www.boost.org) to build.
17  
-
18  
-[Usage]
19  
-
20  
-* Add the ChaiScript include directory to your project's header search path
21  
-* Add "#include <chaiscript/chaiscript.hpp> to your source file
22  
-* Instantiate the ChaiScript engine in your application.  For example, create a new engine with the name 'chai' like so: "chaiscript::ChaiScript chai"
23  
-
24  
-Once instantiated, the engine is ready to start running ChaiScript source.  You have two main options for processing ChaiScript source: a line at a time using "chai.evaluate_string(string)" and a file at a time using "chai.evaluate_file(fname)"
25  
-
26  
-To make functions in your C++ code visible to scripts, they must be registered with the scripting engine.  To do so, call add:
27  
-
28  
-chai.add(chaiscript::fun(&my_function), "my_function_name");
29  
-
30  
-Once registered the function will be visible to scripts as "my_function_name"
31  
-
32  
-[Examples]
33  
-
34  
-ChaiScript is similar to ECMAScript (aka JavaScript(tm)), but with some modifications to make it easier to use.  For usage examples see the "samples" directory, and for more in-depth look at the language, the unit tests in the "unittests" directory cover the most ground.
35  
-
36  
-For examples of how to register parts of your C++ application, see "example.cpp" in the "src" directory. Example.cpp is verbose and shows every possible way of working with the library. For further documentation generate the doxygen documentation in the build folder or see the website http://www.chaiscript.com.
37  
-
38  
-The shortest complete example possible follows:
39  
-
40  
-/// main.cpp
41  
-
42  
-#include <chaiscript/chaiscript.hpp>
43  
-
44  
-double function(int i, double j)
45  
-{
46  
-  return i * j;
47  
-}
48  
-
49  
-int main()
50  
-{
51  
-  chaiscript::ChaiScript chai;
52  
-  chai.add(chaiscript::fun(&function), "function");
53  
-
54  
-  double d = chai.eval<double>("function(3, 4.75);");
55  
-}

0 notes on commit 204ab53

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