Skip to content

Commit

Permalink
document to use Scheme replace instead of Array::replace #319
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Mar 26, 2024
1 parent 1d24c78 commit d9545f3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/docs/lips/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,15 @@ 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`:

```scheme
(replace #/[a-z]+/g (lambda ()
(Promise.resolve "lips"))
"foo bar")
;; ==> "lips lips"
```

### 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
Expand Down

0 comments on commit d9545f3

Please sign in to comment.