18 questions
2
votes
1
answer
326
views
How Can Lisp be defined in terms of y combinator?
I'm watching a lecture SICP 7A and struggling to understand "Define Lisp as Y combinator (time 1:16:15 )"
I think I understood that expt ( calculating exponential of a number like x^n ) can ...
0
votes
2
answers
60
views
How is set-car! modifying my closure environment?
I am coding a meta-circular interpreter and am trying to implement closures. I have a function make-lambda which makes the closure:
(define (make-lambda parameters body env)
(list 'lambda parameters ...
2
votes
1
answer
195
views
Is there a SICP metacircular evaluator that implements call-with-current-continuation
There is source to a SICP metacircular evaluator can be found at https://mitpress.mit.edu/sites/default/files/sicp/code/ch4-mceval.scm
Does anyone know of mceval that includes an implementation of ...
0
votes
3
answers
307
views
How to implement a meta-circular evaluator to parse `[1..10]` in JavaScript?
I want to implement a meta-circular evaluator in JS with support to functional programming.
How can I parse this?
[1..10]
I want to receive 1 and 10
0
votes
3
answers
563
views
Adding primitives in metacircular evaluator
I am working on the metacircular evaluator, and I'm trying to add primitive procedures. I am almost done, except I'm not sure how to add the error. Here is what I have so far:
(define primitive-...
3
votes
1
answer
1k
views
Meta-circular evaluator concept
I'm trying to understand the concept of meta-circular evaluator. According to Wikipedia
In computing, a meta-circular evaluator or meta-circular interpreter is an interpreter which defines each ...
3
votes
1
answer
1k
views
How to bootstrap a Lisp interpreter using the metacircular evaluator
I am implementing a Lisp interpreter in pure C and am having trouble transitioning from C into Lisp.
Following Peter Norvig's steps in his blog post, I have a REPL which so far parses Lisp ...
1
vote
2
answers
122
views
Why can i define a new cond, and Scheme will not get confused with my new cond over the conditional cond?
I have this task where i'm working with a metacircular evaluator, and i define a new cond like this:
(define cond 3)
As well as else:
(define (else x) (/ x 2)
My question is why does this (below) ...
4
votes
1
answer
8k
views
Attempting to call unbound fn, while I have defined it
I am trying to convert SICP's meta-circular evaluator to Clojure. In setup-environment a call to extend-environment does not compile because I get the error "Attempting to call unbound fn". Here's ...
21
votes
4
answers
3k
views
Alan Kay's Eval/Apply Einstein Moment
Alan Kay said that reading the code closely and finding the 1 and only bug in the code on page 13 of the Lisp 1.5 manual, helped him understand Computer Science by a factor of 100 better.
The code in ...
2
votes
2
answers
304
views
Pattern match function in Scheme Meta Circular Evaluator
I'm trying to add a pattern matching function to an existing scheme meta circular evaluator (this is homework) and I'm a bit lost on the wording of the instructions. I was hoping someone more skilled ...
1
vote
1
answer
439
views
Metacircular Interpreter while loop in scheme
Why doesn't this while loop work for the metacircular interpreter. How do i run this in my interactions window ?
((while? exp) (eval (while->combination exp) env))
(define (while-condition expr)...
6
votes
1
answer
264
views
How would you abstract away the boilerplate in this pair of "similar shaped" datatypes
General Question
I have a pair of datatypes that are two different ways of representing the same thing, one records the variable name in String, while the other one records the variable name in Int. ...
3
votes
2
answers
7k
views
Metacircular evaluator of Scheme in Dr. Racket
When I am trying to run an evaluator in Dr. Racket, it shows the error:
'Module Language: there can only be one expression in the definitions window'.
Obviously there are multiple definitions in ...
5
votes
1
answer
1k
views
What is meta-circular interpreter [duplicate]
Can samebody explain it to me what is meta-circular interpreter? Definition on wikipedia is:
A meta-circular evaluator is a special case of a self-interpreter in which
the existing facilities ...