hmgle / Yascm
Licence: gpl-3.0
Yet Another Scheme Interpreter using flex and bison
Stars: ✭ 36
Programming Languages
c
50402 projects - #5 most used programming language
Labels
Projects that are alternatives of or similar to Yascm
Elasticview
Elastic view is a regular CardView, which can flex from user touches
Stars: ✭ 566 (+1472.22%)
Mutual labels: flex
Jflex
The fast scanner generator for Java™ with full Unicode support
Stars: ✭ 380 (+955.56%)
Mutual labels: flex
React Cnode
基于webpack + react + react-router + redux + less + flex.css + ES6 的React版cnode社区
Stars: ✭ 688 (+1811.11%)
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
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
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
Selft Resume Website
selft-resume-website,用react开发的简单的个人简历网站。适合react新手入门练习。
Stars: ✭ 7 (-80.56%)
Mutual labels: flex
yascm
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
- Created by hmgle [email protected]
- Contributors
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].