All Projects → hmgle → Yascm

hmgle / Yascm

Licence: gpl-3.0
Yet Another Scheme Interpreter using flex and bison

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Yascm

Magicmusic
🎵帅气的手机端音乐播放器(vue vue-router vuex flex ...)
Stars: ✭ 350 (+872.22%)
Mutual labels:  flex
Elasticview
Elastic view is a regular CardView, which can flex from user touches
Stars: ✭ 566 (+1472.22%)
Mutual labels:  flex
Flex Flexunit
Mirror of Apache Flex Flexunit
Stars: ✭ 13 (-63.89%)
Mutual labels:  flex
Jflex
The fast scanner generator for Java™ with full Unicode support
Stars: ✭ 380 (+955.56%)
Mutual labels:  flex
Hugo Paper
🥛 A simple, clean, flexible Hugo theme
Stars: ✭ 538 (+1394.44%)
Mutual labels:  flex
React Cnode
基于webpack + react + react-router + redux + less + flex.css + ES6 的React版cnode社区
Stars: ✭ 688 (+1811.11%)
Mutual labels:  flex
Vue Shiyanlou
😘基于vue2和vuex的复杂单页面应用,20+页面53个API(仿实验楼)✨✨
Stars: ✭ 342 (+850%)
Mutual labels:  flex
Alivepdf
[Official AlivePDF] - AlivePDF is a client side AS3 PDF generation library for Adobe Flash, Flex and AIR
Stars: ✭ 29 (-19.44%)
Mutual labels:  flex
Pampy.js
Pampy.js: Pattern Matching for JavaScript
Stars: ✭ 544 (+1411.11%)
Mutual labels:  lisp-interpreter
Anythingpull
下拉刷新,上拉加载,支持弹性,顶部固定,层级,抽屉等等,扩展性强
Stars: ✭ 22 (-38.89%)
Mutual labels:  flex
Arpilisp
A Lisp interpreter for Raspberry Pi implemented in a single ARM assembly file
Stars: ✭ 470 (+1205.56%)
Mutual labels:  lisp-interpreter
Horseshoe
🍧代号马蹄铁。以专题为单位的学习。目前已发布 { Async专题 } { Grid专题 } { Flex专题 } { Git专题 } { Regex专题 } { Redux专题 } { React专题 }
Stars: ✭ 521 (+1347.22%)
Mutual labels:  flex
React Three Flex
💪📦 Flexbox for react-three-fiber
Stars: ✭ 764 (+2022.22%)
Mutual labels:  flex
Re Flex
Resizable Flex layout container components for advanced React web applications
Stars: ✭ 349 (+869.44%)
Mutual labels:  flex
Sprite Flex Layout
grid-layout is a layout engine which implements flex, can use in canvas/node-canvas
Stars: ✭ 15 (-58.33%)
Mutual labels:  flex
Flex
Composer plugin for Symfony
Stars: ✭ 3,731 (+10263.89%)
Mutual labels:  flex
Waffle Grid
An easy to use flexbox grid system.
Stars: ✭ 602 (+1572.22%)
Mutual labels:  flex
Mal
mal - Make a Lisp
Stars: ✭ 8,287 (+22919.44%)
Mutual labels:  lisp-interpreter
Blispr
Lisp-in-progress
Stars: ✭ 27 (-25%)
Mutual labels:  lisp-interpreter
Selft Resume Website
selft-resume-website,用react开发的简单的个人简历网站。适合react新手入门练习。
Stars: ✭ 7 (-80.56%)
Mutual labels:  flex

yascm

Build Status

Yet Another Scheme Interpreter.

Building

The following packages need to install before build:

  • flex
  • bison

Debian/Ubuntu Installation:

sudo apt-get install flex bison

Then run the following:

git clone https://github.com/hmgle/yascm.git
cd yascm
make

If having trouble installing flex/bison, or you don't want to install flex/bison, you can clone the no-flex-bison branch:

git clone -b no-flex-bison https://github.com/hmgle/yascm.git
cd yascm
make

Examples

  • Recursion
$ ./yascm
welcome
> (define (sum x)
    (if (= 0 x) 0 (+ x (sum (- x 1)))))
; ok
> (sum 10000)
50005000
>
  • Closure
$ ./yascm
welcome
> (define (add a)
    (lambda (b) (+ a b)))
; ok
> (define add3 (add 3))
; ok
> (add3 4)
7
> (define my-counter
    ((lambda (count)
       (lambda ()
         (set! count (+ count 1))
         count))
     0)
  )
; ok
> (my-counter)
1
> (my-counter)
2
> (my-counter)
3
>
$ ./yascm
welcome
> (define (A k x1 x2 x3 x4 x5)
    (define (B)
      (set! k (- k 1))
      (A k B x1 x2 x3 x4))
    (if (> 1 k)
        (+ (x4) (x5))
        (B)))
; ok
> (A 10 (lambda () 1) (lambda () -1) (lambda () -1) (lambda () 1) (lambda () 0))
-67
> 
$ ./yascm
; loading stdlib.scm
; done loading stdlib.scm
welcome
> (define Y
    (lambda (h)
      ((lambda (x) (x x))
       (lambda (g)
         (h (lambda args (apply (g g) args)))))))
; ok
> (define fib
    (Y
      (lambda (f)
        (lambda (x)
          (if (> 2 x)
              x
              (+ (f (- x 1)) (f (- x 2))))))))
; ok
> (fib 10)
55
$ ./yascm 
; loading stdlib.scm
; done loading stdlib.scm
welcome
> (load "examples/mceval.scm")
; loading examples/mceval.scm
; done loading examples/mceval.scm
; ok
> (driver-loop)

;;; M-Eval input:
(define fact (lambda (n) (if (= n 0) 1 (* n (fact (- n 1))))))

;;; M-Eval value:
ok

;;; M-Eval input:
(fact 5)

;;; M-Eval value:
120
$ ./yascm 
; loading stdlib.scm
; done loading stdlib.scm
welcome
> ((lambda (x)
      (list x (list (quote quote) x)))
    (quote
      (lambda (x)
        (list x (list (quote quote) x)))))

Testing

$ make test

Authors

LICENSE

GPL Version 3, see the COPYING file included in the source distribution.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].