diff --git a/.github/workflows/codespell.yaml b/.github/workflows/codespell.yaml index ac7aca7f9..b68264dd9 100644 --- a/.github/workflows/codespell.yaml +++ b/.github/workflows/codespell.yaml @@ -23,3 +23,5 @@ jobs: uses: actions/checkout@v4 - name: Codespell uses: codespell-project/actions-codespell@v2 + with: + skip: docs/package-lock.json diff --git a/docs/blog/2024-03-03-lips-history.md b/docs/blog/2024-03-03-lips-history.md index aa6da5b24..e89870e1a 100644 --- a/docs/blog/2024-03-03-lips-history.md +++ b/docs/blog/2024-03-03-lips-history.md @@ -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 diff --git a/docs/blog/2024-03-09-emacs-regex-literals.md b/docs/blog/2024-03-09-emacs-regex-literals.md index 336768d21..07f4f1c5d 100644 --- a/docs/blog/2024-03-09-emacs-regex-literals.md +++ b/docs/blog/2024-03-09-emacs-regex-literals.md @@ -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 diff --git a/docs/docs/intro.md b/docs/docs/intro.md index 57fd17da4..2e34045fe 100644 --- a/docs/docs/intro.md +++ b/docs/docs/intro.md @@ -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 @@ -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: @@ -223,9 +223,9 @@ const interpreter = Interpreter('', { }); }, 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); } @@ -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. @@ -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 diff --git a/docs/docs/lips/REPL.md b/docs/docs/lips/REPL.md index f17fca70b..696319ad0 100644 --- a/docs/docs/lips/REPL.md +++ b/docs/docs/lips/REPL.md @@ -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 @@ -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)` diff --git a/docs/docs/lips/environments.md b/docs/docs/lips/environments.md index e9d808b3e..dce3a0e97 100644 --- a/docs/docs/lips/environments.md +++ b/docs/docs/lips/environments.md @@ -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 @@ -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. diff --git a/docs/docs/lips/extension.md b/docs/docs/lips/extension.md index c352e877b..aea844985 100644 --- a/docs/docs/lips/extension.md +++ b/docs/docs/lips/extension.md @@ -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). @@ -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 @@ -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 @@ -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) diff --git a/docs/docs/lips/functional-helpers.md b/docs/docs/lips/functional-helpers.md index de740be4e..8f25b129c 100644 --- a/docs/docs/lips/functional-helpers.md +++ b/docs/docs/lips/functional-helpers.md @@ -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) @@ -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 @@ -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?)) @@ -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) @@ -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)) @@ -164,7 +164,7 @@ 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 @@ -172,10 +172,10 @@ to `string->number` is Radix of the number (number base, default `10`). To fix t ;; ==> #(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)) @@ -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?))) @@ -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. @@ -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)) diff --git a/docs/docs/lips/intro.md b/docs/docs/lips/intro.md index f4ea49024..06955018a 100644 --- a/docs/docs/lips/intro.md +++ b/docs/docs/lips/intro.md @@ -77,7 +77,7 @@ It also implements: ### Gensyms With lisp macros you can use [gensyms](/docs/scheme-intro/macros#gensyms), they are special Scheme -symbols that use JavaScript symbols behind the sceen, so they are proven to be unique. Additionaly +symbols that use JavaScript symbols behind the sceen, so they are proven to be unique. Additionally you can use named gensym if you pass string as first argument: ```scheme @@ -118,7 +118,7 @@ Read more about [LIPS environments](/docs/lips/environments). ## Procedures Procedures in LIPS have access additional objects `arguments`, but the have nothing to do with JavaScript. -arguments is an array/vector with calling argumnets and it have an object callee which points to the same +arguments is an array/vector with calling arguments and it have an object callee which points to the same procedure. So you can create recursive functions with anonymous lambda: ```scheme @@ -133,7 +133,7 @@ This is classic factorial function written as lambda without the name. ### length property -LIPS functions similary to JavaScript functions also have `length` property that indicate how many +LIPS functions similarly to JavaScript functions also have `length` property that indicate how many arguments a function accepts. If function get more or less argumenets it's not an error like in Scheme. More arguments are ignored, and if less arguments are passed they are `undefined` (`#void`). @@ -145,7 +145,7 @@ and if less arguments are passed they are `undefined` (`#void`). ;; ==> 3 ``` -It return number of number argumnets the rest (dot notation) arguments are ignored. +It return number of number arguments the rest (dot notation) arguments are ignored. ```scheme (define (sum a b . rest) @@ -297,7 +297,7 @@ Example is `Array::push` using with native LIPS types: ;; ==> #(0.5) ``` As you can see the rational number got unboxed and converted into JavaScript float numbers. -Unboxing always can make you loose some information becase LIPS types needs to be converted into native JavaScript +Unboxing always can make you loose some information because LIPS types needs to be converted into native JavaScript data types. And JavaScript doesn't have a notion of rationals, there are only floating point numbers, and big ints. ### Procedures @@ -314,7 +314,7 @@ console.log(greet()); // ==> {__string__: 'hello, LIPS'} ``` -Note that the value was not automagically unboxed becase we are no longer in LIPS Scheme code and LIPS can't access native +Note that the value was not automagically unboxed because we are no longer in LIPS Scheme code and LIPS can't access native JavaScript. So to get the real a string you need to call `valueoOf()`: ```javascript @@ -348,7 +348,7 @@ The same as with JavaScript if you don't pass an argument it will be undefined. ``` ### Helper macros and functions -The most usefull macro in LIPS (for interacting with JavaScript) is `-->` it acts like a chain of +The most useful macro in LIPS (for interacting with JavaScript) is `-->` it acts like a chain of method calls in JavaScript ```scheme @@ -397,7 +397,7 @@ them most of the time. This returned function querySelector from document object in browser. Note that dot a function can only appear as first element of the list (it's handled in special way by the parser). In any other place dot is a pair separator, -see documentation abount [Pairs in Scheme](/docs/scheme-intro/data-types#pairs). +see documentation about [Pairs in Scheme](/docs/scheme-intro/data-types#pairs). * `..` - this is a macro is that simplify usage of `.` procedure: @@ -432,10 +432,10 @@ object returned by expression. ``` Here we get a [style object](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) -from [the DOM node](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement) wihout soring the +from [the DOM node](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement) without sorting the reference to the DOM node. -**NOTE** becasue dot notation in symbols is not special syntax you can use code like this: +**NOTE** because dot notation in symbols is not special syntax you can use code like this: ```scheme (let ((x #(1 2 3))) @@ -491,10 +491,10 @@ in JavaScript: // ==> [1, NaN, NaN] ``` -**NOTE**: the value are differnet becaseu in Shceme i +**NOTE**: the value are different becaseu in Shceme i To fix the issue you can -deifne lambda with single argument: +define lambda with single argument: ```scheme (--> #("1" "2" "3") (map (lambda (str) (string->number str)))) @@ -508,22 +508,22 @@ You can also use one of functional helpers insprired by [Ramda](https://ramdajs. ;; ==> #(1 2 3) ``` -The `unary` [higher-order procedure](/docs/scheme-intro/core#higher-order-functions) acept a singe -procedure and return new procedure that accept only one argumnet. +The `unary` [higher-order procedure](/docs/scheme-intro/core#higher-order-functions) accept a single +procedure and return new procedure that accept only one argument. To read more check [Functional helpers](/docs/lips/functional-helpers). -**WARNING** be carful when using scheme callback functions inside JavaScript. +**WARNING** be careful when using scheme callback functions inside JavaScript. Since some code may be `async` and your code may break. Example of procedures that are not wise to use are: -* `Array::forEach` - this function accepts a callaback but becasue it doesn't return - anything, LIPS can't automatically await the reponse, and your code may execute out of order. +* `Array::forEach` - this function accepts a callaback but because it doesn't return + anything, LIPS can't automatically await the response, and your code may execute out of order. * `String::replace` - this function can accept optional callback and if `lambda` is async you will end up with `[object Promise]` in output string. Any macro or function can return a promise in LIPS, and if any of the expression inside a function return a Promise, the whole - function return a Promise and become async. Here is example code that demostrate the problem: + function return a Promise and become async. Here is example code that demonstrate the problem: ```scheme (--> "foo bar" (replace "foo" (lambda () (Promise.resolve "xxx")))) @@ -542,7 +542,7 @@ Instead of `Array::replace` you should use LIPS Scheme `replace` procedure that ### Regular Expressions LIPS define regular expressions it uses native JavaScript regular expressions. At first, the syntax looked like in JavaScript. It was problematic for the parser -so you were not able to put space after `/` to distingish from divide procedure. +so you were not able to put space after `/` to distinguish from divide procedure. Later, the syntax was renamed into form that start with hash `#/[0-9]/`. The same syntax is used by [Gauche](https://practical-scheme.net/gauche/man/gauche-refe/Regular-expressions.html) implementation. But LIPS supports more flags (same as JavaScript). @@ -569,9 +569,9 @@ In LIPS you can define object literals with `&` You can nest object literals and mix them with different object: ```scheme -(define obj &(:name "Jack" :hobbies #("swiming" "programming"))) +(define obj &(:name "Jack" :hobbies #("swimming" "programming"))) (write obj.hobbies) -;; ==> #("swiming" "programming") +;; ==> #("swimming" "programming") (console.log obj) ;; ==> { name: 'Jack', hobbies: [ 'swiming', 'programming' ] } ``` @@ -585,7 +585,7 @@ Object similar to Scheme vectors, are immutable, and everything inside is quoted ``` But to make it possible to share objects with JavaScript, native LIPS values are automatically unboxed. -So instead of symbol represention you get a JavaScript string. +So instead of symbol representation you get a JavaScript string. You can also use quasiquote with object literals: @@ -722,7 +722,7 @@ You can check if a value is a promise by quoting the expression and using `promi ``` ### Exceptions -LIPS Scheme use JavaSript exception system. To throw an exception you use: +LIPS Scheme use javascript exception system. To throw an exception you use: ```scheme (throw "This is error") @@ -735,7 +735,7 @@ or (raise (new Error "error")) ``` -The `raise` procedure throw any object and `throw` wraps the argumnet in `new Error`. +The `raise` procedure throw any object and `throw` wraps the argument in `new Error`. You can catch exceptions with LIPS specific try..catch..finally: @@ -781,10 +781,10 @@ LIPS also define R7RS guard `procedure` that is just a macro that use ;; ==> Error: error ``` -### JavaScript Generars and interators +### JavaScript Generars and iterators Right now there is no way to define JavaScript generators inside LIPS. You can create iterator using [iteration prorocol](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols), -But to have yeild keyword you need [continuations](/docs/scheme-intro/continuations), they are part of the +But to have yield keyword you need [continuations](/docs/scheme-intro/continuations), they are part of the LIPS Roadmap. Here is example of creating iterator in LIPS: @@ -806,8 +806,8 @@ Here is example of creating iterator in LIPS: ;; ==> #(1 1/2 1/3 1/4 1/5) ``` -`Array.from` can't be used for every possible case becase it will unbox the values (and convert -rational to float), here it doesn't happen becase LIPS don't treat JavaScript iterators in any +`Array.from` can't be used for every possible case because it will unbox the values (and convert +rational to float), here it doesn't happen because LIPS don't treat JavaScript iterators in any special way (it may change in the future). But `Array.from` will convert the array of rationals to float if used on normal vector: @@ -816,10 +816,10 @@ float if used on normal vector: ;; ==> #(0.5 0.3333333333333333 0.25 0.2) ``` -**NOTE**: be carful when using iterator protocol becase any function side Scheme can return a promise. If you would change -quoted object literal `` `&() `` with longhand `object` you will get an error becasue `object` is async. +**NOTE**: be careful when using iterator protocol because any function side Scheme can return a promise. If you would change +quoted object literal `` `&() `` with longhand `object` you will get an error because `object` is async. -You can abstract the use of iteration protocol with a macro, but to have real `yeild` keyword like +You can abstract the use of iteration protocol with a macro, but to have real `yield` keyword like syntax you need `call/cc`. You can also define generators inside JavaScript using `self.eval` (JavaScript global `eval`): @@ -885,7 +885,7 @@ You can also manipulate JavaScript prototypes directly: ;; ==> # ``` -By default toString is not used for represention of objects, but you add representation if you want. +By default toString is not used for representation of objects, but you add representation if you want. See [Homoiconic data types](/docs/lips/extension#new-homoiconic-data-types). ### Node.js @@ -905,7 +905,7 @@ In above code, you can see example of [automagic async/await](#automagic-asyncaw If you have to use callback based API in Node, use [promisify function](https://nodejs.org/api/util.html#utilpromisifyoriginal) from Module util. -You can also use the `Promise` contructor yourself: +You can also use the `Promise` constructor yourself: ```scheme (define fs (require "fs")) @@ -932,9 +932,9 @@ abstracted away with a [lisp macro](/docs/scheme-intro/macros#lisp-macros). ## Binary compiler LIPS Scheme have dumb binary compiler. The compiler is a way to compress the LIPS Scheme code and -create binary file that is faster to load. Compiler is use to make bootstraping faster. The binary +create binary file that is faster to load. Compiler is use to make bootstrapping faster. The binary file use [CBOR](https://en.wikipedia.org/wiki/CBOR) serialization format that is then compressed -with [LZJB](https://en.wikipedia.org/wiki/LZJB) alorithm that is pretty fast. And it can still be +with [LZJB](https://en.wikipedia.org/wiki/LZJB) algorithm that is pretty fast. And it can still be compress further with gzip by the HTTP server. To compile/compress a file you can use `-c` flag when executing `lips` executable. diff --git a/docs/docs/lips/reflection.md b/docs/docs/lips/reflection.md index db83d2859..97485f726 100644 --- a/docs/docs/lips/reflection.md +++ b/docs/docs/lips/reflection.md @@ -15,7 +15,7 @@ You can use standard JavaScript methods to inspect LIPS objects. * JavaScript functions * `Object.keys` - this JavaScript method will return all string keys from an object. * `Object.values` - return the value of the object. - * `Ojbect.entires` - this return array of `[key,value]` pairs. + * `Object.entries` - this return array of `[key,value]` pairs. * `Object.getOwnPropertySymbols` - similar to `Object.keys` but return all symbols ## Numbers diff --git a/docs/docs/lips/sxml.md b/docs/docs/lips/sxml.md index 58a3b0322..939364699 100644 --- a/docs/docs/lips/sxml.md +++ b/docs/docs/lips/sxml.md @@ -83,7 +83,7 @@ With Preact it will just this: (define h preact.h) ``` -Becasue default `pragma->sxml` is `h`. +Because default `pragma->sxml` is `h`. ```scheme (pragma->sxml h) diff --git a/docs/docs/scheme-intro/core.md b/docs/docs/scheme-intro/core.md index 0646288e9..367547144 100644 --- a/docs/docs/scheme-intro/core.md +++ b/docs/docs/scheme-intro/core.md @@ -246,7 +246,7 @@ You also have a shortcut for this case in `when`: ;; ==> "this is true" ``` -There is also create the oposite with `unless`: +There is also create the opposite with `unless`: ```scheme (unless #f @@ -879,7 +879,7 @@ In the same way you can use `alist`. ### Records Anther way to create objects in Scheme, are R7RS records, they were first defined in -[SRFI-9](https://srfi.schemers.org/srfi-9) and included in the offcial standard. +[SRFI-9](https://srfi.schemers.org/srfi-9) and included in the official standard. You can define records that represent cons cells to create linked lists: @@ -1062,7 +1062,7 @@ You can use it like this: (else)) ``` -`cond-expand` have list of lists in format `(identifer . code)`. For example, if you want to add +`cond-expand` have list of lists in format `(identifier . code)`. For example, if you want to add `print` function that is defined in `LIPS`, but not in other implementations, you can use code like this: diff --git a/docs/docs/scheme-intro/input-output.md b/docs/docs/scheme-intro/input-output.md index 943515b20..1de08c54b 100644 --- a/docs/docs/scheme-intro/input-output.md +++ b/docs/docs/scheme-intro/input-output.md @@ -345,10 +345,10 @@ Some scheme implementations have `with-input-from-string` procedure: ;; ==> 10 (1 2 3 4) ``` -Procdure `with-input-from-string` changes the current-input-port so you can use `read` without an +Procedure `with-input-from-string` changes the current-input-port so you can use `read` without an argument. -Another usefull procedure that some Scheme implementations have is `read-all`. It read all the +Another useful procedure that some Scheme implementations have is `read-all`. It read all the S-Expressions from a port and return them as a list. ```scheme diff --git a/docs/docs/scheme-intro/macros.md b/docs/docs/scheme-intro/macros.md index 30aa8fa11..84847d2ee 100644 --- a/docs/docs/scheme-intro/macros.md +++ b/docs/docs/scheme-intro/macros.md @@ -174,8 +174,8 @@ If you try to evaluate the macro, you will get proper results: ### Recursive Macros -You can define recursive macros similary to recursive function. But you need to make sure that the -expansion will stop, similary to recursive functions you may create infinite loops. +You can define recursive macros similarly to recursive function. But you need to make sure that the +expansion will stop, similarly to recursive functions you may create infinite loops. ```scheme (define-macro (alist . body) @@ -192,7 +192,7 @@ You can call this macro to create alist based on its arguments: ``` **Note** recursive call is inside quote and only argument is unquoted. This is required since -recursive macro call needs to appear in the expansion. If you call macro recursivly and don't return +recursive macro call needs to appear in the expansion. If you call macro recursively and don't return macro call as output list you will end up in ifninite recursive call. You can see the macro will expand with macroexpand: @@ -446,7 +446,7 @@ The macro works exactly the same as previous one: ``` ### Identifiers -Inside macros you can add identifers can can be used like keywords from other programming langauges. They match only +Inside macros you can add identifiers can can be used like keywords from other programming languages. They match only if literal symbol was used and it was not shadowed (overwritten) by variable with same name. ```scheme @@ -531,7 +531,7 @@ expact into series of `cons`: (macroexpand '(alist 'foo 10 'bar 20 'baz 30)) ;; ==> (#:cons (#:cons (quote foo) 10) (#:cons (#:cons (quote bar) 20) (#:cons (#:cons (quote baz) 30) ()))) ``` -The output may be differnt depening on implementation. +The output may be different depening on implementation. ### Anaphoric Hygienic Macros By default Scheme `syntax-rules` macros don't allow creating anaphoric macros like lisp macro do. diff --git a/docs/docs/scheme-intro/next-step.md b/docs/docs/scheme-intro/next-step.md index 87c967140..5dea5d362 100644 --- a/docs/docs/scheme-intro/next-step.md +++ b/docs/docs/scheme-intro/next-step.md @@ -22,7 +22,7 @@ A classic, one of the authors of the book is the author of Scheme language. ![SICP Cover](./img/SICP-cover.jpg)
Harold Abelson and Gerald Jay Sussman with Julie Sussman — MIT Press, CC BY-SA 4.0, Wikimedia Commons -I also recommend video lectures. There are two versions. I recommend orignal by Abelson and Sussman from 1986. +I also recommend video lectures. There are two versions. I recommend original by Abelson and Sussman from 1986. [![SICP MIT Lectures](./img/SICP-lectures.jpg)](https://www.youtube.com/playlist?list=PLB63C06FAF154F047) @@ -31,7 +31,7 @@ This is an [official website of the lectures](https://groups.csail.mit.edu/mac/c They are not very good quality, but they are great, and you should have no problems in seeing the code on the blackboard. -There are also more recent lectures from 2010 at [Berkley](https://www.berkeley.edu/) by +There are also more recent lectures from 2010 at [Berkeley](https://www.berkeley.edu/) by [Brian Harvey](https://people.eecs.berkeley.edu/~bh/). Only a little bit better quality. [![UC Berkeley CS 61A The Structure and Interpretation of Computer Programs, Spring 2010](./img/SCIP-lectures-berkley.jpg)](https://www.youtube.com/playlist?list=PLhMnuBfGeCDNgVzLPxF9o5UNKG1b-LFY9) diff --git a/docs/src/components/Interpreter/examples.ts b/docs/src/components/Interpreter/examples.ts index 0120f3b1e..08fe65c63 100644 --- a/docs/src/components/Interpreter/examples.ts +++ b/docs/src/components/Interpreter/examples.ts @@ -46,7 +46,7 @@ const examples = [ (define re #/

([^>]+)<\\/h1>/) ;; --> is a macro that allow chaining ;; of JavaScript methods calls -;; no need to use Promises becasue of automagic +;; no need to use Promises because of automagic ;; promise resolving (let ((msg (--> (fetch "https://scheme.org.pl/test/") (text) diff --git a/docs/src/components/Interpreter/terminal.ts b/docs/src/components/Interpreter/terminal.ts index 766b6b142..c0d3ca8b0 100644 --- a/docs/src/components/Interpreter/terminal.ts +++ b/docs/src/components/Interpreter/terminal.ts @@ -26,7 +26,7 @@ export function initTerminal() { Copyright (c) 2018-${new Date().getFullYear()} [[!;;;;https://jcubic.pl/me]Jakub T. Jankiewicz] Type (env) to see environment with functions macros and variables -You can also use (help obj)to display help for specic function or macro. +You can also use (help obj)to display help for specific function or macro. Use (dir name) to get list of JavaScript properties and (apropos name) to display list of matched names in environment.` diff --git a/docs/src/components/Intro/index.tsx b/docs/src/components/Intro/index.tsx index 45857443b..c1b12ce04 100644 --- a/docs/src/components/Intro/index.tsx +++ b/docs/src/components/Intro/index.tsx @@ -24,7 +24,7 @@ export default function Intro(): JSX.Element {
  • Literal regular expression.
  • Functional helpers (inspired by RamdaJS and Lodash).
  • Possibility modify the parser at runtime (add new syntax, similar to vectors and object).
  • -
  • Possibility to set represention of new data types for write and display. Witth parser extensions you can make new data types have different syntax and still be homoicoic.
  • +
  • Possibility to set representation of new data types for write and display. With parser extensions you can make new data types have different syntax and still be homoicoic.
  • Small JavaScript core with Standard Library implemented in basic Scheme.
  • Full support of Unicode and Emoji.
  • Support for SXML, that allow to write JSX e.g. with Preact or React apps.
  • diff --git a/docs/src/components/Video/index.tsx b/docs/src/components/Video/index.tsx index 82467925a..5895e78e6 100644 --- a/docs/src/components/Video/index.tsx +++ b/docs/src/components/Video/index.tsx @@ -7,7 +7,7 @@ export default function Video(): JSX.Element {
    Video Presentation about LIPS Scheme

    - Video presentation given during FOSDEM 2023 in Declarative and Minimalistic Computing devroom. It discuss different aspect of LIPS Scheme. It first gives quick intro to Lisp and Scheme and later show diffrent features of LIPS Scheme. + Video presentation given during FOSDEM 2023 in Declarative and Minimalistic Computing devroom. It discuss different aspect of LIPS Scheme. It first gives quick intro to Lisp and Scheme and later show different features of LIPS Scheme.