Skip to content

Commit

Permalink
add docs about .. and . operators #374
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Aug 27, 2024
1 parent 1838e73 commit fb48ba9
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions docs/docs/lips/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ The last typecking function is `typecheck-args` that check if all arguments are

## Integration with JavaScript

### Dot operator

### Dot notation
LIPS allow accessing JavaScript objects with dot notation:

Expand Down Expand Up @@ -433,8 +435,9 @@ Read more about [function::bind](https://tinyurl.com/ykvb836s) and
There are two legacy macros that are still part of LIPS, but you don't need
them most of the time.

* `.` - dot function was a first way to interact with JavaScript, it allowed to
get property from an object:
##### The dot operator
`.` - dot function was a first way to interact with JavaScript, it allowed to get property from an
object:

```scheme
(. document 'querySelector)
Expand All @@ -444,13 +447,18 @@ This returned function querySelector from document object in browser. Note that
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 about [Pairs in Scheme](/docs/scheme-intro/data-types#pairs).

* `..` - this is a macro is that simplify usage of `.` procedure:

##### The double dot operator

`..` - this is a macro is that simplify usage of `.` procedure:

```scheme
(.. document.querySelector)
```

You still sometimes may want to use this instead of `-->` when you want to get
##### Usage of Legacy `..` and `.` operators

You still sometimes may want to use `.` instead of `-->` when you want to get
property from an object returned by expression.

In the old version of LIPS, you have to execute code like this:
Expand Down

0 comments on commit fb48ba9

Please sign in to comment.