Skip to content

Commit

Permalink
Addressing PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminNavarro committed Apr 25, 2020
1 parent 4b2bbef commit 3de317b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/13-core-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ Examples:
let io = import('std/io');
let hello = 'hello!';
io.println(hello.at(0));
io.println(hello[5]);
io.println(hello[6]);
```

Output:
```
!
h
(nil)
```
24 changes: 12 additions & 12 deletions src/std/10-std-builder.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Builder

The **builder** module defines a `builder` type that allows to build and install C++ modules to be used with Feral
The **builder** module defines a `builder_t` type that allows to build and install external modules to be used with Feral

A guide on how to write and build modules for Feral can be read [here](https://levelup.gitconnected.com/writing-c-modules-for-feral-391c30ac7739).
A guide on how to write and build modules for Feral can be read [here](https://medium.com/p/writing-c-modules-for-feral-391c30ac7739?source=email-852839018f8a--writer.postDistributed&sk=b2de39e5f849e75e3b4ea9bdeeb1b4db).

All the given examples assume that the **builder** module was imported using:
```
Expand All @@ -14,7 +14,7 @@ let sys = import('std/sys');
## Functions
- [new](#new)

## `builder` Member Functions
## `builder_t` Member Functions
- [make_dll](#make_dll)
- [add_comp_opts](#add_comp_opts)
- [add_inc](#add_inc)
Expand All @@ -24,7 +24,7 @@ let sys = import('std/sys');

### new
```
builder.new() -> builder
builder.new() -> builder_t_t
```
Creates a new builder with default build settings

Expand All @@ -36,12 +36,12 @@ io.println(build);

Possible output:
```
typeid<14>{linker_flags: , lib_flags: -lferalvm -lgmpxx -lgmp -lmpfr , lib_dirs: -L/usr/lib -L/usr/local/lib/feral , srcs: , ccache: /usr/bin/ccache , compiler: g++, is_dll: false, compiler_opts: -std=c++11 -O2 , inc_dirs: -I/usr/include }
builder_t{linker_flags: , lib_flags: -lferalvm -lgmpxx -lgmp -lmpfr , lib_dirs: -L/usr/lib -L/usr/local/lib/feral , srcs: , ccache: /usr/bin/ccache , compiler: g++, is_dll: false, compiler_opts: -std=c++11 -O2 , inc_dirs: -I/usr/include }
```

### make_dll
```
builder.make_dll() -> builder
builder.make_dll() -> builder_t
```
Indicates that the module should be built as a dynamic library instead of an executable program

Expand All @@ -61,7 +61,7 @@ Is DLL? true. Compiler options: -std=c++11 -O2 -shared -fPIC -rdynamic -Wl,-rpa

### add_comp_opts
```
builder.add_comp_opts(opt: string) -> builder
builder.add_comp_opts(opt: string) -> builder_t
```
Adds `opt` to the list of options passed to the compiler

Expand All @@ -81,7 +81,7 @@ Compiler options: -std=c++11 -O2 -g

### add_inc
```
builder.add_inc(inc_dir: string) -> builder
builder.add_inc(inc_dir: string) -> builder_t
```
Adds `inc_dir` to the list of include directories passed to the compiler

Expand All @@ -101,7 +101,7 @@ Include directories: -I/usr/include -I/usr/local/include

### add_lib
```
builder.add_lib(lib_flag : string, lib_dir = '' : string) -> builder
builder.add_lib(lib_flag : string, lib_dir = '' : string) -> builder_t
```
Adds `lib_flag` and `lib_dir` to the list of libraries and library directories passed to the compiler

Expand All @@ -125,7 +125,7 @@ Libraries and directories

### add_src
```
builder.add_src(src: string) -> builder
builder.add_src(src: string) -> builder_t
```
Adds `src` to the list of source files passed to the compiler

Expand All @@ -145,9 +145,9 @@ Source files: src/hello.cpp

### perform
```
builder.perform(output_file: string, .kw_args) -> builder
builder.perform(output_file: string, .kw_args) -> int
```
Builds the module and produces the `output_file` binary output. The possible keyword arguments are:
Builds the module and produces the `output_file` binary output and returns zero on success or an error code on failure. The possible keyword arguments are:
- `src`: Additional source files to build. Default if empty
- `inc`: Include files location. Default is `include`
- `lib`: Library files location. Default is `build`
Expand Down
2 changes: 1 addition & 1 deletion src/std/5-std-maps.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Gives the output:
{Answer?: 42, 0: Zero, 1: One}
```

Note that the elements are not stored in any particular order and thus does not necessarily follow the given one
Note that the elements are not stored in any particular order and thus do not necessarily follow the given one

### len
```
Expand Down

0 comments on commit 3de317b

Please sign in to comment.