Skip to content

Commit

Permalink
Fixed all tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pyldin601 committed Oct 26, 2017
1 parent c480fc4 commit 6f6fda1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/eval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,7 @@ const applyExpression = (expression: any, env: Env) => {
const callMethod = (env: Env, method: string, object: any, args: any[]): any => {
const patchedArgs = args.map(arg => {
if (arg instanceof Lambda && !isLMType(object)) {
return (...innerArgs) => {
return evalExpression([arg, ['quote', ...innerArgs]], env);
};
return (...innerArgs) => evalExpression([arg, [new LMSymbol('quote'), ...innerArgs]], env);
}
return arg;
});
Expand Down
3 changes: 2 additions & 1 deletion src/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import optimizeTailCall from './optimizeTailCall';
import { QUOTE } from './special';
import { APOSTROPHE, CLOSE_PARENTHESIS, IToken, OPEN_PARENTHESIS } from './tokens';
import { isList } from './util';
import LMSymbol from "./types/LMSymbol";

type IList = IToken | IToken[];

Expand Down Expand Up @@ -64,7 +65,7 @@ const postProcess = (list: IList[]): IList[] => {
}

if (head === APOSTROPHE) {
return iter(_.tail(tail), [...acc, [QUOTE, _.head(tail)]]);
return iter(_.tail(tail), [...acc, [new LMSymbol(QUOTE), _.head(tail)]]);
}

return iter(tail, [...acc, head]);
Expand Down

0 comments on commit 6f6fda1

Please sign in to comment.