More helpful libraries.md

This commit is contained in:
Erik Svedäng 2018-03-14 20:32:41 +01:00
parent 53a51a1f61
commit 763ffed0f2
2 changed files with 41 additions and 21 deletions

View File

@ -24,7 +24,7 @@ The key features of Carp are the following:
* [Installation](docs/Install.md) - how to build the Carp compiler
* [The Compiler Manual](docs/Manual.md) - how to compile code and configure your projects
* [Carp Language Guide](docs/LanguageGuide.md) - syntax and semantics of the language
* [Libraries](docs/Libraries.md) - the various libraries that come built into Carp
* [Libraries](docs/Libraries.md) - how to work with libraries and modules
* [Tooling](docs/Tooling.md) - supported editors
* [Game Example](examples/game.carp) - an example of how to use SDL with Carp

View File

@ -1,40 +1,60 @@
## Working with libraries and modules
Below is a list of 'core' modules that comes included with the Carp compiler.
Modules marked with the symbol '⦁' are imported by default, other modules are imported by loading their file. For example, to get access to the Bench module, do the following:
```clojure
(load "Bench.carp")
```
External librares (listed at the end of this file) can be loaded in the same way, using their location in your file system as the path. To make a library publically available in an easy way you can add it to your Carp project's `search-path` (found by running `:p` in the repl). Here's how you'd add the NCurses library so that it can be loaded with just `(load "NCurses.carp")`.
```clojure
(Project.config "search-path" "~/Projects/carp-ncurses")
```
This line of configuration can be put into a `~/.carp/profile.carp` file to make it apply everywhere.
## Core Modules
### Basics
* [Macros ⦁](../core/Macros.carp)
* [Interfaces ⦁](../core/Interfaces.carp)
* [Dynamic ⦁](../core/Dynamic.carp) (only available in the repl and at compile time)
### Numerics
* [Int](../core/Int.carp)
* [Int](../core/Int.carp)
* [SafeInt](../core/SafeInt.carp)
* [Long](../core/Long.carp)
* [Bool](../core/Bool.carp)
* [Float](../core/Float.carp)
* [Double](../core/Double.carp)
* [Long](../core/Long.carp)
* [Bool](../core/Bool.carp)
* [Float](../core/Float.carp)
* [Double](../core/Double.carp)
* [Vector](../core/Vector.carp)
* [Geometry](../core/Geometry.carp)
* [Statistics](../core/Statistics.carp)
### Text
* [String](../core/String.carp)
* [Char](../core/Char.carp)
* [String](../core/String.carp)
* [Char](../core/Char.carp)
* [Format](../core/Format.carp)
* [Pattern](../core/Pattern.carp)
* [Pattern](../core/Pattern.carp)
### Collections
* [Array](../core/Array.carp)
* [Array](../core/Array.carp)
### Misc
* [IO](../core/IO.carp)
* [System](../core/System.carp)
* [SDL](../core/sdl.carp)
* [Macros](../core/Macros.carp)
### System
* [IO ⦁](../core/IO.carp)
* [System ⦁](../core/System.carp)
### Development
* [Debug ⦁](../core/Debug.carp)
* [Test](../core/Test.carp)
* [Statistics](../core/Statistics.carp)
* [Bench](../core/Bench.carp)
* [Debug](../core/Debug.carp)
* [Interfaces](../core/Interfaces.carp)
* [Dynamic](../core/Dynamic.carp) (Functions used in the REPL / at compile time.)
### Graphics
* [OpenGL](../core/OpenGL.carp)
* [GLFW](../core/GLFW.carp)
* [SDL](../core/SDL.carp)
* [GLFW](../core/GLFW.carp)
* [OpenGL](../core/OpenGL.carp)
## External Libraries
* [Stdint](https://github.com/hellerve/stdint) (A wrapper around the types defined in stdint.h)