SkillAgentSearch skills...

Reductor

A toy language that shows how simple and elegant the concepts behind concatenative languages are.

Install / Use

/learn @ympbyc/Reductor
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

reductor

A toy language that shows how easy it is to implement a powerful concatenative language, and nothing more.

[ "examples/quot.reductor" load,

  :double (int -- int)
   [ 2 * ] define,

  :map ([a] (a -- b) -- [b])
   [ over empty?
     [ drop ]
     [ [ [ car ] [ cdr ] bi ] dip
       tuck map [call] dip swap cons ]
     if ] define,

   [ 1 2 3 4 5 ] [ double ] map . ]

install

git clone https://github.com/ympbyc/reductor.git
cd reductor
lein deps

running

cat examples/map.reductor | lein run

test

a=`cat examples/map.reductor | lein run`

if [ $a = "(2 4 6 8 10)" ] ; then
  echo "ok"
else
  echo "error"
fi

Related Skills

View on GitHub
GitHub Stars5
CategoryDevelopment
Updated8y ago
Forks0

Languages

Clojure

Security Score

55/100

Audited on Sep 26, 2017

No findings