5 ms·
Syntax is different from semantics. To give a concrete example, say you want a part of a program to use lazy constructs. In racket, you could use `#lang lazy` f
by Bogdanp 8y ago
Syntax is different from semantics. To give a concrete example, say you want a part of a program to use lazy constructs. In racket, you could use `#lang lazy` for that one module and then import and use that code within `#lang racket` modules.
Despite having the same syntax, `#lang lazy` and `#lang racket` behave differently:
#lang lazy
(define (say-hi _)
(displayln "Hi!"))
(say-hi (exit 1))
$ racket lazy-example.rkt
Hi!
$ echo $?
0
versus
#lang racket
(define (say-hi _)
(displayln "Hi!"))
(say-hi (exit 1))
$ racket racket-example.rkt
$ echo $?
1
Exact same syntax, different semantics.