Questions tagged [evaluator]
59 questions
7
votes
3 answers
In the SECD Machine how does "rap" work?
I am writing a simulator of the SECD machine in C# guided by the description on Wikipedia. I have the basic operations completed, but I am not sure how to implement the rap instruction.
At Wikipedia it says about rap:
rap works like ap, only that…

cdiggins
- 17,602
- 7
- 105
- 102
4
votes
1 answer
How to write a custom evaluator for Share in Alfresco 4.2.2?
For example, I need the evaluator, which I could use to show the action in Share. If the current user is the author of the document, then I'll show the action.
The project structure is presented below…
user1134181
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
1 answer
Evaluating "true" in meta-circular evaluator in Clojure
I converted the Structure and Interpretation of Computer Programs (SICP) version of the meta-circular evaluator to Clojure. The main difference (besides syntax) is the handling of the environment structure. Since you cannot use set-car! and set-cdr!…

user2609980
- 10,264
- 15
- 74
- 143
3
votes
1 answer
A Haskell Mini-Language
I'm attempting to define an evaluator for the language E and to be quite frank I'm completely at a loss for how to fix all the errors I keep getting with how the eval type is defined. I've spent several hours now reading up on interpreters, monads…

JustKeepSwimming
- 55
- 1
- 9
3
votes
6 answers
Need Help Understanding Recursive Prefix Evaluator
This is a piece of code I found in my textbook for using recursion to evaluate prefix expressions. I'm having trouble understanding this code and the process in which it goes through.
char *a; int i;
int eval()
{ int x = 0;
…

user3421510
- 91
- 9
3
votes
1 answer
OpenGL 2D Evaluator Mesh cannot set larger
I have this OpenGL project I'm working on that involves creating a 2D flat mesh to mess around with. The code is as such:
#include
#include
GLfloat ctrlpoints[9][9][3] = {
{{0, 0, 0}, {1, 0, 0}, {2, 0, 0}, {3, 0, 0}, {4, 0,…

user1858045
- 33
- 2
2
votes
2 answers
Can I run Lua interpreter in evaluator mode?
Many of script interpreters like irb or node works as evaluator. If I execute this code,
10
it will evaluate and print the value itself, and make no error.
When I installed lua it worked as executor rather than evaluator. So when I put 10, it will…

eonil
- 83,476
- 81
- 317
- 516
2
votes
1 answer
Adding params to Apache Spark's abstract Evaluator class
I'm building a Spark Application and am using the Evaluator class within some custom Estimators/Transformers. I've run into an issue where the Evaluator base class does not implement the metricName param that most (all?) of its descendants…

Derek Kaknes
- 961
- 8
- 10
2
votes
3 answers
Mutually recursive evaluator in Haskell
Update: I've added an answer that describes my final solution (hint: the single Expr data type wasn't sufficient).
I'm writing an evaluator for a little expression language, but I'm stuck on the LetRec construct.
This is the language:
type Var =…

Tom Lokhorst
- 13,658
- 5
- 55
- 71
2
votes
5 answers
How to allow users to define financial formulas in a C# app
I need to allow my users to be able to define formulas which will calculate values based on data. For example
//Example 1
return GetMonetaryAmountFromDatabase("Amount due") * 1.2;
//Example 2
return GetMonetaryAmountFromDatabase("Amount due") *…

Peter Morris
- 20,174
- 9
- 81
- 146
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
2
votes
3 answers
Neo4j Using a custom evaluator to get the depth a node was retrieved at
I'm using the latest version of Neo4j to build up a graph of nodes and relationships with the Java API.
My problem is that I need to traverse the nodes to a certain depth. There may exist a relationship between two nodes at the same depth in the…

jenny_flynn
- 55
- 1
- 6
2
votes
2 answers
Mule 3.2. How to Evaluate Empty Session Variable in Flow?
How can I check if my session variable is null or empty in this CHOICE
Its not working for me.
…

Kawika
- 95
- 5
- 10
1
vote
1 answer
How can I pass a set of instances to a function or predicate in Alloy Analyzer's Evaluator?
BLUF: I have a predicate which takes as arguments an instance of a signature and a set of instances of the same signature. Upon generating instances of the model, I'd like to pass instances of the signature to the predicate, but am at a loss for how…