[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A couple of questions about goops method parameters

From: Panicz Maciej Godek
Subject: Re: A couple of questions about goops method parameters
Date: Fri, 5 Sep 2014 22:10:26 +0200

>> Using FRP, we can model with mutable state in a pure, functional way.

OTOH, when you take a look at the example code (Mario), you can trace
the notion of objects. E.g.
mario = { x = 0, y = 0, vx = 0, vy = 0, dir = "right" }

What else is that, if not an object?
"Well, it's a structure", one could say -- because it has no methods.
However, this is just what the most rudimentary GOOPS objects are -- a
named tuple (provided that you use no virtual slots). I think that it
is a big problem of Scheme, that it does not have any noncontroversial
and commonly accepted way for creating named tuples.

Furthermore, instead of using explicit side effects, as one would
normally do, the Mario example first defines a step function, and
calls "foldp step mario input". Although I do appreciate efforts like
in "How to Design Worlds" book or "Introduction to Systematic Program
Design" course, to avoid explicit mutation (because as SICP shows, it
complicates the model of computation), I don't see so many benefits of
avoiding mutation in complex realtime systems.

Actually, when I look at the Mario example, I have a feeling that the
code would be much cleaner and easier to follow if it was written in a
more traditional imperative/callback style.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]