sampoder / escm

๐ŸŒˆ Scheme, now written with emojis.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

๐ŸŒˆ escm <your-code>.escm

Scheme, now written with emojis. Install it on your computer by downloading escm.py and editing your shell's configuration path to include:

escm() {
  if [ -z "$1" ]; then
    echo "Usage: escm [path_to_file].escm"
  else
    if [[ $1 == *.escm ]]; then
      python3 /path/to/escm.py "$1"
      [your_scheme_interpreter] "${1%.escm}.scm"
    else
      echo "Usage: escm [path_to_file].escm"
    fi
  fi
}

Here's an example snippet that prints the 21st number in the Fibonacci sequence:

(๐ŸŸฐ (fibonacci n) (๐Ÿคท (< n 2) n (+ (fibonacci (- n 1)) (fibonacci (- n 2)))))

(๐Ÿ–จ๏ธ (fibonacci 21))

Usage is fairly simple, write Scheme as you usually would but use emojis for actions / command words instead of words.

Here's the list of currently available aliases:

Emoji Function Emoji Function
โ–ถ๏ธ begin ๐ŸŸฐ define
๐Ÿคท if ๐Ÿ“ length
๐Ÿ“ž apply ๐Ÿ–จ๏ธ display
๐Ÿ“ displayln โš ๏ธ error
๐Ÿ” eval ๐Ÿšช exit
๐Ÿ“‚ load โ†ฉ๏ธ newline
๐Ÿ–จ๏ธโ€ print ๐Ÿ“ƒ? atom?
๐Ÿ”ข? integer? ๐Ÿ“ฆ? list?
๐Ÿ‘ฅ? pair? ๐Ÿ’ก? procedure?
๐Ÿ”ฎ? promise? ๐Ÿ”ค? string?
๐Ÿ”ฃ? symbol? ๐Ÿ—‘๏ธ? null?
๐Ÿ“„โž• append ๐Ÿฅ• car
๐Ÿ“ค cdr โœŒ๏ธโž• cons
๐Ÿ““ list ๐Ÿ—บ๏ธ map
๐Ÿ•ต๏ธ filter ๐Ÿ”€ reduce
1๏ธโƒฃ! set-car! 2๏ธโƒฃ! set-cdr!
โž• + โž– -
โœ–๏ธ * โž— /
๐Ÿ˜ abs โฌ†๏ธ expt
๐Ÿ”— modulo ๐Ÿ˜ƒ quotient
โซ remainder ๐ŸŒ’ acos
๐ŸŒ“ acosh ๐ŸŒ— asin
๐ŸŒ˜ asinh ๐ŸŒ› atan
๐ŸŒœ atan2 ๐ŸŒ™ atanh
๐ŸŒ† ceil ๐ŸŒ… copysign
๐ŸŒ„ cos ๐ŸŒƒ cosh
๐ŸŒ„ degrees ๐ŸŒ‡ floor
๐ŸŒˆ log ๐ŸŒˆ๐Ÿ”Ÿ log10
๐ŸŒŠ log1p ๐ŸŒŠ2๏ธโƒฃ log2
๐ŸŒŒ radians ๐ŸŒŸ sin
๐ŸŒ  sinh ๐ŸŒ‹ sqrt
๐ŸŒš tan ๐ŸŒž tanh
๐ŸŒก๏ธ trunc ๐ŸŸฐ? eq?
๐Ÿค? equal? โŒ not
๐Ÿ”ต? even? ๐Ÿ”ด? odd?
0๏ธโƒฃ? zero? ๐Ÿ” cond
๐Ÿค and ๐Ÿ™ or
๐Ÿท๏ธ let ๐Ÿ begin
๐Ÿ“‘ lambda ๐Ÿ“œ quote
๐ŸŸฐ-๐Ÿค define-macro ๐Ÿ”Ž expect
๐Ÿ”-โœ‚๏ธ unquote-splicing ๐Ÿ•’ delay
๐ŸŒŠ-๐ŸŒŠ cons-stream ๐Ÿ”’! set!
๐Ÿป Shoutout to any future 61A-ers learning Scheme! That was the inspiration for this project... wahoo :)

About

๐ŸŒˆ Scheme, now written with emojis.


Languages

Language:Python 100.0%