Chris Rathman wrote:

* You could take advantage of currying in the cases TmApplication and TmBegin if you defined eval in curried form.

I'm not sure I follow what the advantages are? Would it require that I make "env" the first paramater, since it's the same for the map and foldl functions?

Yes. Then you could write:

  | eval env (TmBegin exp) = foldl (eval env o #1) ValUnit exp
  | ...
| eval env (TmApplication(f, args)) = apply(eval env f, map (eval env) args)

Admittedly, that's only a minor advantage here.

* It does not seem to make sense to define ValClosure to carry a *list* of terms - you never use it.

I had put that in the last minute as that seems to be what the Scheme code does. I think Scheme uses it for the function definitions within other functions. I took it out as it's not in use, but I suppose that the parser is probably the key to whether it's needed or not.

Yes, but then TmLambda had to support a list of terms accordingly, AFAICS.

* In the valueToString function, note that Char.toString does perform escaping. For symmetry, you might want to do the same for strings (via String.toString). Also, I'd probably add quotes.

I was having problems along these lines, but I'm not sure I actually got them worked out. In the meantime, I put it back to the way it was.

Looks perfectly fine to me.

Cheers,
- Andreas

--
Andreas Rossberg, [EMAIL PROTECTED]

_______________________________________________
alice-users mailing list
[email protected]
http://www.ps.uni-sb.de/mailman/listinfo/alice-users

Reply via email to