Skip to content

Commit

Permalink
Merge 88135e4 into ba4331c
Browse files Browse the repository at this point in the history
  • Loading branch information
odino committed Mar 27, 2020
2 parents ba4331c + 88135e4 commit ac75cdb
Show file tree
Hide file tree
Showing 17 changed files with 1,096 additions and 284 deletions.
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.12.0
Binary file modified docs/abs.wasm
Binary file not shown.
7 changes: 2 additions & 5 deletions docs/installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,13 @@ if [ "${MACHINE_TYPE}" = 'x86_64' ]; then
ARCH="amd64"
fi

VERSION=1.11.4

echo "Trying to detect the details of your architecture."
echo ""
echo "If these don't seem correct, head over to https://github.com/abs-lang/abs/releases"
echo "and download the right binary for your architecture."
echo ""
echo "OS: ${OS}"
echo "ARCH: ${ARCH}"
echo "VERSION: ${VERSION}"
echo ""
echo "Are these correct? [y/N]"

Expand All @@ -50,8 +47,8 @@ do
exit 1
done < "/dev/stdin"

BIN=abs-${VERSION}-${OS}-${ARCH}
wget https://github.com/abs-lang/abs/releases/download/${VERSION}/${BIN} -O ./abs
BIN=abs-${OS}-${ARCH}
wget https://github.com/abs-lang/abs/releases/latest/download/${BIN} -O ./abs
chmod +x ./abs

echo "ABS installation completed!"
Expand Down
2 changes: 1 addition & 1 deletion docs/misc/3pl.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ another file is specified:

```
$ ~/projects/abs/builds/abs
Hello alex, welcome to the ABS (1.11.4) programming language!
Hello alex, welcome to the ABS programming language!
Type 'quit' when you're done, 'help' if you get lost!
⧐ require("abs-sample-module")
Expand Down
4 changes: 0 additions & 4 deletions docs/misc/technical-details.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,6 @@ ERROR: type mismatch: NULL + NUMBER
[78:8] h["g"] += 1
```

## Roadmap

We're currently working on [1.8](https://github.com/abs-lang/abs/milestone/15).

## Next

That's about it for this section!
Expand Down
40 changes: 40 additions & 0 deletions docs/types/array.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,16 @@ of strings or numbers:
[1, 2, 3].contains(4) # false
```
### chunk(size)
Splits the array into chunks of the given size:
```bash
[1, 2, 3].chunk(2) # [[1, 2], [3]]
[1, 2, 3].chunk(10) # [[1,2,3]]
[1, 2, 3].chunk(1.2) # argument to chunk must be a positive integer, got '1.2'
```
### every(f)
Returns true when all elements in the array
Expand Down Expand Up @@ -173,6 +183,13 @@ Returns the first element that returns `true` when applied to the function `f`:
["hello", 0, 1, 2].find(f(x){type(x) == "NUMBER"}) # 0
```
A shorthand syntax supports passing a hash and comparing
elements to the given hash:
```bash
[null, {"key": "val", "test": 123}].find({"key": "val"}) # {"key": "val", "test": 123}
```
### len()
Returns the length of the array:
Expand Down Expand Up @@ -348,6 +365,29 @@ Returns an array with unique values:
[1, 1, 1, 2].unique() # [1, 2]
```
### intersect(array)
Computes the intersection between 2 arrays:
```bash
[1, 2, 3].intersect([]) # []
[1, 2, 3].intersect([3]) # [3]
[1, 2, 3].intersect([3, 1]) # [1, 3]
[1, 2, 3].intersect([1, 2, 3, 4]) # [1, 2, 3]
```
### diff(array)
Computes the difference between 2 arrays
(elements that are only on either of the 2):
```bash
[1, 2, 3].diff([]) # [1, 2, 3]
[1, 2, 3].diff([3]) # [1, 2]
[1, 2, 3].diff([3, 1]) # [2]
[1, 2, 3].diff([1, 2, 3, 4]) # [4]
```
## Next
That's about it for this section!
Expand Down
2 changes: 1 addition & 1 deletion docs/types/builtin-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ $ cat ~/.absrc
source("~/abs/lib/library.abs")
$ abs
Hello user, welcome to the ABS (1.11.4) programming language!
Hello user, welcome to the ABS programming language!
Type 'quit' when you are done, 'help' if you get lost!
⧐ adder(1, 2)
3
Expand Down
21 changes: 21 additions & 0 deletions docs/types/number.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@ by default:
10.333.round(1) # 10.3
```

### between(min, max)

Checks whether the number is between `min` and `max`:

``` bash
10.between(0, 100) # true
10.between(10, 100) # true
10.between(11, 100) # false
```

### ceil()

Rounds the number up to the closest integer:
Expand All @@ -92,6 +102,17 @@ Rounds the number up to the closest integer:
10.3.ceil() # 11
```

### clamp(min, max)

Clamps the number between min and max:

``` bash
10.clamp(0, 100) # 10
10.clamp(0, 5) # 5
10.clamp(50, 100) # 50
1.5.clamp(2.5, 3) # 2.5
```

### floor()

Rounds the number down to the closest integer:
Expand Down
25 changes: 25 additions & 0 deletions docs/types/string.md
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,31 @@ back as many characters as the value of `start`:
"string".slice(-3, 0) # "ing"
```

### camel()

Converts the string to camelCase:

```bash
"a short sentence".camel() # aShortSentence
```

### snake()

Converts the string to snake_case:

```bash
"a short sentence".snake() # a_short_sentence
```


### kebab()

Converts the string to kebab-case:

```bash
"a short sentence".snake() # a-short-sentence
```

## Next

That's about it for this section!
Expand Down
Loading

0 comments on commit ac75cdb

Please sign in to comment.