Skip to content

Commit

Permalink
automated fix of grammar with codespell
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Mar 28, 2024
1 parent 8b68df8 commit f55be61
Show file tree
Hide file tree
Showing 20 changed files with 90 additions and 88 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/codespell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ jobs:
uses: actions/checkout@v4
- name: Codespell
uses: codespell-project/actions-codespell@v2
with:
skip: docs/package-lock.json
4 changes: 2 additions & 2 deletions docs/blog/2024-03-03-lips-history.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ to make it more powerful and easier to interact with JavaScript.

It all started in February 2018 when I've written the first version of Lisp interpreter. You can
still see the code on [CodePen](https://codepen.io/jcubic/pen/gvvzdp). Then I moved the
[devlopment to GitHub](https://github.com/jcubic/lips) and named the project LIPS. The first release
[development to GitHub](https://github.com/jcubic/lips) and named the project LIPS. The first release
(version 0.2.0) is marked as Mar 2018.

At the begining it was Lisp based on Scheme, but at one point after version
At the beginning it was Lisp based on Scheme, but at one point after version
[0.20.1 dated as Jul 1, 2020](https://github.com/jcubic/lips/releases/tag/0.20.1), I've started
adding features on devel branch and decided that I want full Scheme implementation. But it turns out
that there are way to many breaking changes to release next version. So I decided that I will
Expand Down
2 changes: 1 addition & 1 deletion docs/blog/2024-03-09-emacs-regex-literals.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ were ignored by Emacs scheme mode (because they were inside symbol).

I asked a [question on emacs-devel mailing
list](https://lists.gnu.org/archive/html/emacs-devel/2024-02/msg00896.html), on how to solve this
problem. I didn't get any reply for days, then suddenly somone [reply with this emacs lisp code
problem. I didn't get any reply for days, then suddenly someone [reply with this emacs lisp code
snippet](https://lists.gnu.org/archive/html/emacs-devel/2024-03/msg00282.html).

```lisp
Expand Down
12 changes: 6 additions & 6 deletions docs/docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ After adding script tag with main file, you can use Scheme code inside script ta

**NOTE**: Only the core of LIPS is written in JavaScript, almost half of it it's written in Scheme.
So if you want to load the standard library (to have full LIPS), you should use `bootstrap` or
`data-bootstrap` attribute that will load it for you. You can optionaly specify the location of the
`data-bootstrap` attribute that will load it for you. You can optionally specify the location of the
file.

```html
Expand Down Expand Up @@ -71,7 +71,7 @@ breaking changes no new stable version was released and instead 1.0 beta started
If LIPS is installed globally just use `lips` command to start the REPL:
![LIPS REPL sesssion in Terminal](/img/screencast.gif)
![LIPS REPL session in Terminal](/img/screencast.gif)
By default, splash screen is shown you can hide it with option `-q`. If you're using bash you can create an
alias:
Expand Down Expand Up @@ -223,9 +223,9 @@ const interpreter = Interpreter('<name>', {
});
},
stdout: OutputPort(function(obj) {
// you will get any obect and need to print it
// you will get any object and need to print it
// you can use this.get('repr') function from LIPS environment
// to get represention of the object as string
// to get representation of the object as string
if (typeof obj !== 'string') {
obj = this.get('repr')(obj);
}
Expand All @@ -237,7 +237,7 @@ Anything you add to the object passed to Interpreter will be added to global sco
The Interpreter have a method `exec` that work the same as thhe one exported from LIPS.
### Bootstraping
### Bootstrapping
**Note**: that you also need to bootstrap the standard library to have fully working Scheme system.
Expand All @@ -251,7 +251,7 @@ about `let-env` expression check [documentation about LIPS environments](/docs/l
## Editor support
Note that Scheme is popular lanugage and editors usually support its syntax. But also not every editor
Note that Scheme is popular language and editors usually support its syntax. But also not every editor
may support literal regular expressions that are part of LIPS. If your editor doesn't support them,
you can report an issue if the project is Open Source. Literal Regular Expressions are also part
of [Gauche](https://practical-scheme.net/gauche/man/gauche-refe/Regular-expressions.html) and
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/lips/REPL.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Web REPL you can access from [Home page](/) or as a [bookmarklet](/#bookmark) us

## Node.js REPL

Node.js version of the REPL, also supports syntax hightlighting and auto indentation. It also
Node.js version of the REPL, also supports syntax highlighting and auto indentation. It also
supports [paste bracket mode from Node.js](https://github.com/nodejs/node/pull/47150) (added by
[Jakub T. Jankiewicz](https://jcubic.pl/me) and released in
[v20.6.0](https://nodejs.org/en/blog/release/v20.6.0)), to properly handle copy-paste of Scheme
Expand All @@ -40,7 +40,7 @@ There are few procedures useful in the REPL:
* `env` - function returns list of symbols which is everything that is inside an environment,
* `dir` - function return all properties from an object including those in prototype chain (a class).
* `repr` - function return representation of the object as a string, it's inspired by Python. The
`repr` function accepts two argumnets the second one is a boolean that indicate if it should work
`repr` function accepts two arguments the second one is a boolean that indicate if it should work
like write or like display. Write will write string with quotes. So if you wnat the strings inside
the string to be quoted use `(repr obj #t)`

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/lips/environments.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Since environments are JavaScript objects you can access its properties like `__
;; ==> "let"
```

Here you can acccess name of the lexical environment.
Here you can access name of the lexical environment.

## Frames

Expand Down Expand Up @@ -154,7 +154,7 @@ You can mix lexical scope chain with frames:
## Global environment

in `lips.env` is user global environment but real global environment where all functions and macros that are
located (it's also a place where names from bootstraping are saved) is `lips.env.__parent__`.
located (it's also a place where names from bootstrapping are saved) is `lips.env.__parent__`.

If you want to really overwrite builtin function.

Expand Down
8 changes: 4 additions & 4 deletions docs/docs/lips/extension.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ There are two ways to extend LIPS Scheme, one is through [macros](#macros) and t
LIPS allow creating Lisp macros and Scheme hygienic macros. Right now the limitations of macros is
that they are runtime. There are no expansion time. Macros act like function calls, but they
transform the code and the interpreter evaluates the code that is returned by the macro. They ware
impemented like this, because this is how I undertood the macros when they first got
implemented like this, because this is how I understood the macros when they first got
implemented. There is a [plan to create proper macro
expansion](https://github.com/jcubic/lips/issues/169).

Expand Down Expand Up @@ -311,7 +311,7 @@ common lips reader macros).
;; ==> "foo \\ bar"
```

This extension implements raw strig, like in Python, where you don't need to escape the charcters that are thread literally.
This extension implements raw string, like in Python, where you don't need to escape the characters that are thread literally.
Similarly, you can implement strings that use backticks, you only need to replace `#\"` with `` #\` ``.

```scheme
Expand All @@ -331,7 +331,7 @@ Similarly, you can implement strings that use backticks, you only need to replac
;; ==> "foo \\ bar"
```

With this feature in hand you can implement full string interpolation (that will probbaly be part of
With this feature in hand you can implement full string interpolation (that will probably be part of
LIPS Scheme in the future).

### Limitations
Expand Down Expand Up @@ -372,7 +372,7 @@ argument to the `set-repr!` handler.

### Combining with syntax extensions

You can combine syntax extensions with custom represention:
You can combine syntax extensions with custom representation:

```scheme
(set-special! ":P" 'make-person lips.specials.SPLICE)
Expand Down
32 changes: 16 additions & 16 deletions docs/docs/lips/functional-helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ defined in [SRFI-1](https://srfi.schemers.org/srfi-1/srfi-1.html).

## Curry

[Curry](https://en.wikipedia.org/wiki/Currying) is a common function in functional programing that
[Curry](https://en.wikipedia.org/wiki/Currying) is a common function in functional programming that
return a new function with predefined arguments. The classic version, returns functions that accept
one argumnet and keep returning new function until all argumments are passed. In LIPS there is more
useful verion of curry, that allow to pass more than one argument at the time. This is a common way
curry is implemented. This is working in LIPS becase Scheme lambdas has length property that
indecate number of argumnets.
one argument and keep returning new function until all argumments are passed. In LIPS there is more
useful version of curry, that allow to pass more than one argument at the time. This is a common way
curry is implemented. This is working in LIPS because Scheme lambdas has length property that
indicate number of arguments.

```scheme
(define (sum a b c)
Expand Down Expand Up @@ -59,8 +59,8 @@ This is common function from Python. LIPS Scheme version works exactly the same
```

If used with one argument it returns `n` numbers starting from `0`.
If used with two argumnets, the first one is starting number and the second one is the limit.
When used with tree arguments, the last argumnets is a step between the result numbers.
If used with two arguments, the first one is starting number and the second one is the limit.
When used with tree arguments, the last arguments is a step between the result numbers.

## filter
This is a common function in JavaScript and Python. But LIPS procedure also allow accepting
Expand All @@ -74,7 +74,7 @@ regular expression as a filter.
```

## complement
Function return the oposite of the predicate:
Function return the opposite of the predicate:

```scheme
(define not-null? (complement null?))
Expand Down Expand Up @@ -120,7 +120,7 @@ The last example use interop with JavaScript see [Integration with
JavaScript](/docs/lips/intro#integration-with-javascript) to know more.

## flip
This is very useful procedure that return new procedure with swaped first two arguments.
This is very useful procedure that return new procedure with swapped first two arguments.

```scheme
(take '(1 2 3 4) 2)
Expand All @@ -146,7 +146,7 @@ You can use curry with filter to create filter procedures:
;; ==> (1 2 3 4 5 6 7 8 9)
```

Another thing you can do is curry the take procedure to get only two elemets from the list with help of flip:
Another thing you can do is curry the take procedure to get only two elements from the list with help of flip:

```scheme
(define first-two (curry (flip take) 2))
Expand All @@ -164,18 +164,18 @@ This is a classic error:
;; ==> #(1 +nan.0 +nan.0 +nan.0)
```

The error happen becase Array::map pass additional argumnets not only a value, and second argument
The error happen because Array::map pass additional arguments not only a value, and second argument
to `string->number` is Radix of the number (number base, default `10`). To fix the issue you can use `unary`:

```scheme
(--> #("1" "2" "3" "4") (map (unary string->number)))
;; ==> #(1 2 3 4)
```

Binary and n-ary work similary but limit the number of arguments to 2 or any number.
Binary and n-ary work similarly but limit the number of arguments to 2 or any number.

## always and once
`always` is a procedure that return procedure that alwasy return same value
`always` is a procedure that return procedure that always return same value

```scheme
(map (always 1) (range 10))
Expand Down Expand Up @@ -249,7 +249,7 @@ all elemebts (`every`).

## pipe

Pipe is higher ordder procedure that accept functiosn and aguments and return a new function that apply those function in order:
Pipe is higher ordder procedure that accept functions and aguments and return a new function that apply those function in order:

```scheme
(define non-zero (curry filter (complement zero?)))
Expand All @@ -267,7 +267,7 @@ The code removes the zeros from list before applying the fraction that will thro
## folding

LIPS define function `reduce` that is an alias to standard Scheme procedure `fold-right` and fold that is the same
as `fold-left`. Both procedures works similary. The take a procedure and a list and reduce it into a single value.
as `fold-left`. Both procedures works similarly. The take a procedure and a list and reduce it into a single value.

**NOTE** the reduce works differently than in JavaScript, the callback function get accumulator in last argument.

Expand All @@ -288,7 +288,7 @@ The function also accept more than one list.
;; ==> (4 "quuz" 3 "baz" 2 "bar" 1 "foo")
```

`fold` function work similary but the order of execution is reversed.
`fold` function work similarly but the order of execution is reversed.

```scheme
(fold cons '() '(1 2 3 4))
Expand Down
Loading

0 comments on commit f55be61

Please sign in to comment.