Skip to content

Commit

Permalink
add escaped symbols to scheme tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Mar 1, 2024
1 parent e4f688c commit 513c125
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/docs/scheme-intro/data-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,24 @@ You can also convert string to symbol with:

Scheme have conversion of using `->` arrow to define procedure that convert types.

In R<sub>7</sub>RS spec there is also a way to define symbols with special characters. Those symbols start and end with a vertical bar character.

```scheme
(define |foo bar| 10)
(define |foo () bar| 20)
(display |foo bar|)
;; ==> 10
(display |foo () bar|)
;; ==> 20
```

You can also put escaped characters in symbol, like in strings:

```scheme
(symbol=? '|\x3BB;| 'λ)
;; ==> #t
```

## Comments

There are 3 types of comments in Scheme:
Expand Down

0 comments on commit 513c125

Please sign in to comment.