Skip to content

Commit

Permalink
(docs) add name regex for search + wrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Dec 23, 2024
1 parent 7127605 commit b8f19d7
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions docs/docs/lips/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,8 @@ Example of procedures that are not wise to use are:
"[object Promise] bar"
```

Instead of `Array::replace` you should use LIPS Scheme `replace` procedure that works with async `lambda`:
Instead of `Array::replace` you should use LIPS Scheme `replace` procedure that works with async
`lambda`:

```scheme
(replace #/[a-z]+/g (lambda ()
Expand All @@ -591,11 +592,12 @@ 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 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).
LIPS define regular expressions it uses native JavaScript regex. At first, the syntax looked like
in JavaScript. It was problematic for the parser 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).

### Vectors
In LIPS Scheme vectors are JavaScript arrays. So you can execute methods on them with `-->` macro:
Expand Down

0 comments on commit b8f19d7

Please sign in to comment.