Skip to content

Commit

Permalink
corrected spelling across the entire project
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenLove committed Jul 11, 2024
1 parent 3ac32cf commit bc82a6b
Show file tree
Hide file tree
Showing 25 changed files with 61 additions and 51 deletions.
6 changes: 4 additions & 2 deletions .config/cspell.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
// you can check which dictionary has a word with `npx cspell trace yourWord`
{
"version": "0.2",
"ignorePaths": ["target", "legacy", "*.lock"],
"ignorePaths": ["target", "legacy", "**/*.lock"],
"useGitignore": false,
"enableFiletypes": ["*", "Vimscript"],
"dictionaryDefinitions": [
{
"name": "custom-dictionary",
Expand All @@ -16,6 +18,6 @@
"dictionaries": ["custom-dictionary", "rust", "makefile", "softwareTerms"],
"words": [],
"flagWords": [],
"ignoreWords": ["atwo", "btwo", "ctwo", "dtwo"],
"ignoreWords": ["Emmmmm", "atwo", "btwo", "ctwo", "dtwo", "hexy"],
"import": []
}
8 changes: 8 additions & 0 deletions .config/custom-dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ evaled
evals
execvp
Expandvec
Falh
falsey
fclose
fcntl
Expand All @@ -136,6 +137,7 @@ footgun
fopen
fprn
fract
frood
FSIZE
ftype
fxhasher
Expand All @@ -151,8 +153,11 @@ GOTPCREL
gpwclark
greenyellow
guifg
Habcdefiklmnpqrstuvx
hasher
hashkey
haskey
hoopy
iargs
idents
instring
Expand Down Expand Up @@ -222,6 +227,7 @@ movsbl
movzbl
MSGQUEUE
mult
munge
myfn
myfun
namespacemath
Expand Down Expand Up @@ -416,6 +422,7 @@ Syscall
syscall
sysconf
tadd
takek
targ
TCALL # opcode for a tail call
tcall
Expand Down Expand Up @@ -475,6 +482,7 @@ VECPSH
vecs
vecvalues
vhandle
vimscript
vlen
VMEM
waitpid
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

![Rust](https://github.com/sl-sh-dev/sl-sh/workflows/Rust/badge.svg?branch=master)

## Note this is a new expermental version, see ./legacy/ for the original version (slush).
## Note this is a new experimental version, see ./legacy/ for the original version (slush).

Simple Lisp SHell (slosh) is a lisp based shell written in Rust. It is not POSIX
compliant and makes no effort to be. Sl-sh should run on any *nix platform as
Expand Down Expand Up @@ -160,7 +160,7 @@ Note: These are all compiled to bytecode and once compiled are not dynamic anymo
### Features
- Lisp reader (no reader macros yet)
- Lisp lists (pair/concell based)
- Lisp lists (pair/conscell based)
- Vectors
- Tail call optimization
- Continuations (call/cc)
Expand Down Expand Up @@ -213,5 +213,5 @@ generated from the source code.
All of this is covered in `doc/README.md`
Must be compiled in lisp-test mode for appropriate documenation functions to be present (`cargo build --features lisp-test`).
Must be compiled in lisp-test mode for appropriate documentation functions to be present (`cargo build --features lisp-test`).
2 changes: 1 addition & 1 deletion bridge_adapters/src/lisp_adapters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//! TODO PC ISSUE #7 - returning values via annotated or lifetime?
//! To avoid allocations when converting a slosh &Value back to a rust type that was mutated
//! don't return anything. If it is necessary for the API to return some value.
//! ...either use an annotation on an input argument `fn myfun(#[likethis] returnme: &mut String, someotherval: String) -> VMResult<()>`
//! ...either use an annotation on an input argument `fn myfun(#[likeThis] returnme: &mut String, someotherval: String) -> VMResult<()>`
//! or a lifetime... might be easier to do the annotation.
//!
//!
Expand Down
4 changes: 2 additions & 2 deletions bridge_adapters/src/lisp_adapters/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ mod tests {
for val in loose_strings_as_vals {
let _loose_string: LooseString = val
.sl_into_ref(vm)
.expect("This value should be convertable to a LooseString");
.expect("This value should be convertible to a LooseString");
}
}

Expand All @@ -533,7 +533,7 @@ mod tests {

let sample = LooseString::Owned("hello world".to_string());
let val: Value =
Value::sl_from(sample, vm).expect("This LooseString should be convertable to a Value");
Value::sl_from(sample, vm).expect("This LooseString should be convertible to a Value");
assert!(matches!(val, Value::String(_)));
}
}
2 changes: 1 addition & 1 deletion bridge_macros/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ implemented and then coerce the rust types into sl-sh Expressions with the
appropriate errors and call the original function, `int_to_float` with rust
types.
- once `builtin_int_to_float` exists, `intern_int_to_float` must be manually
called in the add_buitlins function like:
called in the add_builtins function like:

```rust
pub fn add_type_builtins<S: BuildHasher>(
Expand Down
10 changes: 5 additions & 5 deletions bridge_macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1044,16 +1044,16 @@ fn generate_parse_fn(
}

fn num_required_args(params: &[Param]) -> usize {
params.iter().fold(0, |accum, nxt| {
params.iter().fold(0, |accumulator, nxt| {
if nxt.handle == TypeHandle::Direct {
accum + 1
accumulator + 1
} else {
accum
accumulator
}
})
}

/// write the builtin_ version of the provided function. This function is the function taht makes
/// write the builtin_ version of the provided function. This function is the function that makes
/// a direct call to the original rust native function to which the macro was applied. To accomplish
/// this the builtin_ function generates takes some number of ArgType structs (the wrapper enum that
/// enables passing optional and varargs). the body of the function handles unwrapping the ArgType
Expand Down Expand Up @@ -1643,7 +1643,7 @@ pub fn sl_sh_fn(

//TODO
// - functions that return Values, tuple return types?
// - fcns that accept iters?
// - functions that accept iters?
// - then... compare against inline the function being called... randomize variable names...
// and fn names too? could pick some random string and prefix all generated idents.
// - ISSUE #119 trybuild!
Expand Down
4 changes: 2 additions & 2 deletions builtins/src/conversions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Section: conversion
env,
"ref",
global_ref,
r#"Usage: (ref symol) -> Value
r#"Usage: (ref symbol) -> Value
If symbol is defined then return the thing it references.
Expand All @@ -119,7 +119,7 @@ Section: conversion
env,
"def?",
is_def,
r#"Usage: (def? symol) -> #t/#f
r#"Usage: (def? symbol) -> #t/#f
If symbol is defined then return true else false.
Expand Down
4 changes: 2 additions & 2 deletions builtins/src/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ fn str_map_inner(vm: &mut SloshVm, func: Value, string: Value) -> VMResult<Strin
let mut res = String::new();
for ch in UnicodeSegmentation::graphemes(string, true) {
let param = vm.alloc_char(ch);
// Dont use '?' or return early until the heap_unsticky() call below.
// Don't use '?' or return early until the heap_unsticky() call below.
vm.heap_sticky(param);
let val = match func {
Value::Lambda(handle) => {
Expand Down Expand Up @@ -520,7 +520,7 @@ pub fn add_str_builtins(env: &mut SloshVm) {
str_replace,
r#"Usage: (str-replace string old-pattern new-pattern) -> string
Replace occurances of second string with third in the first string.
Replace occurrences of second string with third in the first string.
Section: string
Expand Down
2 changes: 1 addition & 1 deletion builtins/tests/MACRO_HELP.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ To get macro expansion output for a given test

If macro expansion for the test/trybuild/ is needed it is a little more complicated.

Why? well, if you put failling tests in `/tests/` then cargo tests fails so you
Why? well, if you put failing tests in `/tests/` then cargo tests fails so you
can't do that. But `cargo expand --test` relies on finding modules in a test directory
so, you can move a test from trybuild up one directory but move it back b/c
otherwise `cargo test` will fail and CI won't pass.
Expand Down
2 changes: 1 addition & 1 deletion builtins/tests/convert_string_pass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub fn return_string() -> VMResult<String> {
Ok("return_string".to_string())
}

//TODO PC document use of generics in return parameters and limitatons,
//TODO PC document use of generics in return parameters and limitations,
/// obligatory doc
#[sl_sh_fn(fn_name = "return_loose_string")]
pub fn return_loose_string<'a>() -> VMResult<LooseString<'a>> {
Expand Down
14 changes: 7 additions & 7 deletions compile_state/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ impl Specials {
def: add_special(vm, "def", r#"Usage: (def symbol doc_string? expression) -> expression
Adds an expression to the current namespace. Return the expression that was defined.
Symbol is not evaluted. Can take an option doc string (docstrings can only be
Symbol is not evaluated. Can take an option doc string (docstrings can only be
set on namespaced (global) symbols).
Section: core
Expand All @@ -226,7 +226,7 @@ Example:
(test::assert-equal "Two" test-do-two)
(test::assert-equal "Three" test-do-three)
(let (test-do-one nil)
; Add this to tthe let's scope (shadow the outer test-do-two).
; Add this to the let's scope (shadow the outer test-do-two).
(test::assert-equal "Default" (def test-do-four "Default"))
; set the currently scoped value.
(set! test-do-one "1111")
Expand All @@ -240,7 +240,7 @@ Example:
set: add_special(vm, "set!", r#"Usage: (set! symbol expression) -> expression
Sets an existing expression in the current scope(s). Return the expression that was set.
Symbol is not evalauted.
Symbol is not evaluated.
Set will set the first binding it finds starting in the current scope and then
trying enclosing scopes until exhausted.
Expand All @@ -262,7 +262,7 @@ Example:
(test::assert-equal "One" test-do-one)"#),
do_: add_special(vm, "do", r#"Usage: (do exp0 ... expN) -> expN
Evaluatate each form and return the last.
Evaluate each form and return the last.
Section: core
Expand Down Expand Up @@ -532,7 +532,7 @@ Example:
Destructive form that replaces the cdr (second item) in a pair with a new expression.
If used on a proper list will replace everthing after the first item.
If used on a proper list will replace everything after the first item.
Can be used on nil to create a pair (nil . expression).
Section: pair
Expand Down Expand Up @@ -680,7 +680,7 @@ recursive call would work in a non-tail position but could blow the stack if
it is to deep- unlike a recur or tail position recursive call).
NOTE: potential footgun, the let macro expands to a lambda (fn) and a recur used
inside the let would bind with the let not the enclosing lambda (this would
apply to any macro that also expands to a lamda- this is by design with the
apply to any macro that also expands to a lambda- this is by design with the
loop macro but would be unexpected with let).
Section: core
Expand Down Expand Up @@ -1039,7 +1039,7 @@ Example:
"#),
mk_err: add_special(vm, "mk-err", r#"Usage: (mk-err :keyword value)
Create an error object. This does not raise the error but merly cretes it.
Create an error object. This does not raise the error but merely creates it.
Can use car/cdr to extract the keyword and value.
Section: core
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/compile/compile_call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ pub(crate) fn compile_call_reg(
.chunk
.encode2(MOV, result as u16 + 1, reg, env.own_line())?;
}
// Lie abpout this being a tail call because we can not emit the BMOV yet.
// Lie about this being a tail call because we can not emit the BMOV yet.
compile_params(env, state, cdr, result + 2, false)?;
let b_reg = result + cdr.len() + 3;
if b_reg > state.max_regs {
Expand Down
4 changes: 2 additions & 2 deletions doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ rm -rf ./book/*
# generated site entrypoint at `./book/index.html`
```

TODO PC need md files in a specific folder named after a section to be inlined within the section documetnation
TODO PC need md files in a specific folder named after a section to be inlined within the section documentation

## Important information

0. Must be compiled in lisp-test mode for appropriate documenation functions to be present (`cargo build --features lisp-test`).
0. Must be compiled in lisp-test mode for appropriate documentation functions to be present (`cargo build --features lisp-test`).
1. To create new documentation files add them in markdown format to the `doc/src/` directory and
then reference them in `doc/src/SUMMARY.md` when slosh builds the documentation it will create
an html file in the format specified in the SUMMARY.md table of contents at the provided relative URL.
Expand Down
10 changes: 5 additions & 5 deletions doc/src/errors.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# ERRORS

## Error Type
The error type consists of an identifing keywork and a data/payload value. This
The error type consists of an identifying keywork and a data/payload value. This
value is typically a string but can be any valid value.

(type [error]) returns :Error
The form (car [error]) returns the keyword identifing this error.
The form (car [error]) returns the keyword identifying this error.
The form (cdr [error]) returns the data value for the error.
Note the use of car/cdr to pull apart an error even though it is not of the pair type.
Use (mk-err :[ID] value) to create an error type or (err :[ID] value) to "raise" an error (see below).

## Raising an error
Runtime errors will be "raised". This means the program execution will halt and the debugger will be entered. Currently this only allows examing the running state but will eventually include the ability to modify state and restart as other Lisps allow. Code can raise an error with the err form, for instance (err :some-error-type "This is my error") will raise an error and interrupt the program.
Runtime errors will be "raised". This means the program execution will halt and the debugger will be entered. Currently this only allows examining the running state but will eventually include the ability to modify state and restart as other Lisps allow. Code can raise an error with the err form, for instance (err :some-error-type "This is my error") will raise an error and interrupt the program.

Note, the (get-error FORM+) form can be used to programmaticly return a raised error instead of breaking to the debugger.
Note, the (get-error FORM+) form can be used to programmatically return a raised error instead of breaking to the debugger.

## Returning an error
Code can return an error instead of breaking into the debugger. Use the (mk-err :[ERROR ID] vallue) to create an error and then use it as any other value (return it from a function for instance). This may be appropraite for a common error that does not warrent breaking to the debugger.
Code can return an error instead of breaking into the debugger. Use the (mk-err :[ERROR ID] vallue) to create an error and then use it as any other value (return it from a function for instance). This may be appropriate for a common error that does not warrent breaking to the debugger.

## References
See the docs string for:
Expand Down
8 changes: 4 additions & 4 deletions lisp/core.slosh
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,8 @@ Example:
(inc! ~i-name)))))

#%
Evaluate body a number of times equal to times' numnrical value. Includes an
incrementing reference binding, idx-bind, accesible in body.
Evaluate body a number of times equal to times' numerical value. Includes an
incrementing reference binding, idx-bind, accessible in body.

Section: core

Expand Down Expand Up @@ -342,7 +342,7 @@ Example:
Usage: (dyn key value expression) -> result_of_expression

Creates a dynamic binding for key, assigns value to it and evals expression under it.
Note that if key must be a symbol and is not evaluted.
Note that if key must be a symbol and is not evaluated.

The binding is gone once the dyn form ends. This is basically a set! on the
binding in an unwind protect to reset it when done. When used on a global will
Expand Down Expand Up @@ -543,7 +543,7 @@ Example:
Usage: (cond ((test form*)*) -> result

Evaluate each test in order. If it is true then evaluate the form(s) in an
implicit do and return the result. Stop evaluting at the first true test.
implicit do and return the result. Stop evaluating at the first true test.
Return nil if no conditions are true.

Section: conditional
Expand Down
4 changes: 2 additions & 2 deletions lisp/iterator.slosh
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ Example:

#%
Loops over each element in an iterator.
The bind parameter is bound to the current element of items and is accesible
The bind parameter is bound to the current element of items and is accessible
in body. Body is evaluated a number of times equal to the items in the iterator.

Section: iterator
Expand Down Expand Up @@ -326,7 +326,7 @@ Example:


#%
reduce is used to amalgamate an iterator and an intitial value,
reduce is used to amalgamate an iterator and an initial value,
according to the reducing function provided. The reducing-fcn should be a function
of two arguments. In the first iteration of reduce, the init-val will be used as
the first argument to the reducing-fcn and (iter) will be used as the
Expand Down
2 changes: 1 addition & 1 deletion lisp/sh-color.slosh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Section: shell

Example:
(assert-true (sys-command? "ls"))
(assert-false (sys-command? "rst-not-a-comand-strsnt"))
(assert-false (sys-command? "rst-not-a-command-strsnt"))
%#
(defn sys-command? (com)
(if (or (str-empty? com)(identical? com.0 \/)(identical? com.0 \.))
Expand Down
Loading

0 comments on commit bc82a6b

Please sign in to comment.