Are there any purely functional Schemes or Lisps?

前端 未结 9 1189
不知归路
不知归路 2020-12-24 07:10

I\'ve played around with a few functional programming languages and really enjoy the s-expr syntax used by Lisps (Scheme in particular).

I also see the advantages of

9条回答
  •  情书的邮戳
    2020-12-24 07:39

    The new Racket language (formerly PLT Scheme) allows you to implement any semantics you like with s-expressions (really any syntax). The base language is an eagerly evaluated, dynamically typed scheme variant but some notable languages built on top are a lazy scheme and a functional reactive system called Father Time.

    An easy way to make a purely functional language in Racket is to take the base language and not provide any procedures that mutate state. For example:

    #lang racket/base
    (provide (except-out (all-from-out racket/base) set! ...more here...))
    

    makes up a language that has no set!.

提交回复
热议问题