Questions tagged [metacircular]
16 questions
21
votes
4 answers
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 question is the 1st release of eval & apply that…

GlassGhost
- 16,906
- 5
- 32
- 45
6
votes
1 answer
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. Currently, they're both defined. However, I would…

xiaolingxiao
- 4,793
- 5
- 41
- 88
5
votes
1 answer
What is meta-circular interpreter
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 of the parent interpreter are directly applied to…

peto1234
- 369
- 5
- 11
4
votes
1 answer
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 part of the code:
(... loads of methods for creating…

user2609980
- 10,264
- 15
- 74
- 143
3
votes
2 answers
Metacircular evaluator, implementing the environment
I am trying to implement the Metacircular Evaluator in Scheme according to the well-known book "Structure and Interpretation of Computer Programs" by Harold Abelson and Gerald Jay…

Yura Perov
- 105
- 1
- 1
- 7
3
votes
1 answer
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 feature of the interpreted language using a similar…

Tuomas Toivonen
- 21,690
- 47
- 129
- 225
2
votes
1 answer
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 call-with-current-continuation?

user825628
- 179
- 1
- 2
- 5
2
votes
1 answer
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 expressions into Lisp data structures and serializes the…

Jon Deaton
- 3,943
- 6
- 28
- 41
2
votes
2 answers
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 in this regard could help me interpret this.
The…

user3029486
- 289
- 1
- 3
- 10
2
votes
2 answers
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 this window, an evaluator has multiple definitions,…

Hari Chaudhary
- 630
- 1
- 7
- 20
1
vote
2 answers
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) actually work?
(cond ((= cond 2) 0)
(else (else…

Eddie Kusturica
- 37
- 4
1
vote
1 answer
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) (cadr expr))
(define (while-body expr) (caddr…

user3450718
- 58
- 1
- 5
0
votes
3 answers
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

NrBanMex
- 305
- 2
- 8
0
votes
3 answers
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-procedures
(list (list 'car car)
(list 'cdr…

Isaac
- 273
- 3
- 19
0
votes
1 answer
The metacircular evaluator
I have to write scheme with scheme.. quiet funny, but that's the situation.
Any way, Here's an example for trying to write "lambda" expression with all the proucedors that I may use,and I need help in writing "Let" expression also. how can I…

Unknown user
- 44,551
- 16
- 38
- 42