Code Monkey home page Code Monkey logo

gwen's Introduction

gwen

another list processing style programming language

compared to other lisps

  • no false or nil, only 0
  • no dotted lists, the last cdr is not shown
  • functions are curried, there are no variadic functions (but macros receive list arguments)
  • application is left to right one argument at a time
  • data are own constant functions
  • singleton list is quote, there are no nullary functions, just pass 0 and ignore it :)
  • (, a b c d) is like begin
  • (\ a b c x) is lambda (a b c are arguments and x is body, use , for multiple expressions)
  • (? a b c d e f g) is cond (g is default branch)
  • (: a x b y c z (a b c)) is like let* (if no expression then return last definition)

common functions

  • cons is X, car is A, cdr is B
  • . prints a value and returns it

code examples

a quine

L is macro similar to list

((\ l (L l (L l))) '(\ l (L l (L l))))

church numerals

exponent operation exp would simply be identity function

(: (add a b f x) (a f (b f x))
   (mul a b f) (a (b f))
   (zero a b) b
   one (zero zero)
   two (add one one)
   three (add one two)
   four (add two two)
   five (add two three)
   six (mul two three)
   seven (add one six)
 (. (mul two (mul five (mul six seven)) (+ 1) 0)))

gwen's People

Contributors

cofinalsubnets avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.