Skip to content
This repository has been archived by the owner on Jun 3, 2018. It is now read-only.

kenpusney/repl-lang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

repl-lang

The REPL Programming Language

Why REPL?

'Cause many languages do not have a REPL.

What is REPL

  • (loop (print (eval (read))))
  • Read-Eval-Print Loop
  • Ruby-Enlighted Programming Language
  • Ruby's Endless Programming Language

endless

  • lambda literal
  • type/class literal(repl/type)
  • ?: / and / or instead of if..else
  • modifier expression(if/while/unless/until)

Install

git clone git://github.com/kenpusney/repl-lang.git
cd repl-lang && ./repl

Examples

# make expression
make Object

# polish notation and `&` operator
:new & Object
:+.& 1,2

UGLisp

require 'repl/uglisp'
(:list.& 1,2,3,4)
#=> [1,2,3,4]

(:car.& (:list.& 1,2,3,4))
#=> 1

(:cdr.& (:list.& 1,2,3,4))
#=> [2,3,4]

Endless Programming with Ruby

require 'repl/type'

## define a new class:
k = :type.&({
        attr_reader: [:x],
        attr_writer: [:x],
        attr_accessor: [:z],
        init:   ->(x){  @x = x },
    },Object) ## default superclass: Object