349 reputation
313
bio website
location
age
visits member for 2 years, 5 months
seen Dec 1 at 19:42

I am.


Feb
12
comment A pattern to “atomically” update a pair of objects
Probably instead of Account there should be Bank, as there are much fewer banks than accounts. Then each bank would have to manage its accounts.
Feb
12
comment A pattern to “atomically” update a pair of objects
This is just a general idea, this exact code would not be very efficient, i suppose.
Jan
27
comment A pattern to “atomically” update a pair of objects
@Kaerber, but the Updates defined in Transaction can only modify Accounts through their public methods, so what public methods would the Accounts have?
Jan
27
comment A pattern to “atomically” update a pair of objects
Which methods would be exposed as public? How a method sent to one Account can change another Account?
Jan
27
comment A pattern to “atomically” update a pair of objects
Could you tell please how and where UpdateSource and UpdateDestiantion are defined?
Jan
27
comment A pattern to “atomically” update a pair of objects
I am only playing with OOP in Racket. The question is not about data integrity, but about the class interface: it does not seem possible to me to expose somehow a single public method (or maybe this is not how it should be done?) to update both states without exposing public methods for updating just one state. I suspect the answer can be very language-specific, but if i see the keywords, maybe i'll be able to search for it myself. If this is not clear, maybe i'll add an example later.
Jan
7
comment Why does DrRacket IDE considers some identifiers as “symbols” and some as “keywords”? What is the difference?
I mean, who decides which identifiers are keywords? How should i maintain the lists of keywords?
Jan
6
comment Why does DrRacket IDE considers some identifiers as “symbols” and some as “keywords”? What is the difference?
Is this a bug then?
Jan
1
comment If immutable objects are good, why do people keep creating mutable objects?
I cannot find yet where i've read this about the origins of OOP, but according to Wikipedia, some Integrated Regional Information System of a large container shipping company OOCL is written in Smalltalk.
Aug
22
comment Who created the idea(s) of the first loop constructs?
I can imagine, as it usually happens, the first time a loop was used in a computer program, nobody called it "a loop."
May
17
comment What is the name of λx.λf.fx (like reverse apply) in lambda calculus? Does the corresponding function have a standard name in programming?
Which one? Where? How much?
Apr
17
comment In Scheme, what is formally a program's state?
Thanks for the reference, i will look at that book. About the substitution model, it is claimed in SICP that it is not appropriate once you allow assignment.
Apr
17
comment In Scheme, what is formally a program's state?
I am now at lecture 5 out of 10 on SICP, and it looks to me that the environment (in the form of a pointer in a rooted tree of frames, each frame consisting of variable bindings), should be a part of the state.
Apr
17
comment In Scheme, what is formally a program's state?
I think when i was asking for a simplest definition, i meant the one where transitions from state to state would be the easiest to define. Otherwise it can be said that a program has only 2 states: the program itself and its result, and everything happens during the transition from the first to the second.
Apr
14
comment In Scheme, what is formally a program's state?
There is however something awkward with this semantics/state: its use of define seems far from optimal. To make a "small step" of replacing an identifier with its definition, the whole program must be searched for a matching define or set!. This semantics looks to me a bit impractical even from theoretical view point. The rules for searching for a matching define are complicated (for example, it should not occur in a quoted expression).
Apr
3
comment In Scheme, what is formally a program's state?
John, your definition of state agrees with this lecture of a course on Structure and Interpretation of Computer Programs.
Mar
29
comment In Scheme, what is formally a program's state?
Thanks for the link, Paul. I hoped there was an easier description of a state that "machine memory". By the way, it is not a complete definition, because you would need to also define what is stored in the memory and how. I will try to look through the article.
Mar
29
comment In Scheme, what is formally a program's state?
I have though of this, but could not convince myself that there is nothing more in a state. For example, if there is some external input-output. Could you give me some reference to more information on small-step semantics for Scheme, please? It is hard for me for now to translate operational semantics to such "program transformation" semantics, for example i do not see what would be a small step to reduce something like (quote x), or why this form is "irreducible".
Mar
28
comment In Scheme, what is formally a program's state?
I think i would be satisfied with any single answer out of infinitely many, preferably the shortest one, for any single "semantics". (I guess that without a semantics a Scheme program is just a sequence of Unicode symbols anyway.) If a Scheme program is not to be evaluated but to be "reduced", i would be interested to hear about it too, but from what i have read so far, it looks like after all a Scheme program describes a "computation" in some sense. As far as i know, a computation must be a sequence of states.
Mar
28
comment In Scheme, what is formally a program's state?
Thanks for the information and references, but i am looking for a one- or two-line definition if possible.