digitalmars.D.learn - imports and a data structure (any critique welcome)
- Jonathan (14/14) Dec 26 2013 I come from Haskell, so please excuse any functional programming
- TheFlyingFiddle (3/17) Dec 27 2013 Could you please clarify the question? I did not understand what
- TheFlyingFiddle (1/1) Dec 27 2013 Found your other post nwm.
I come from Haskell, so please excuse any functional programming idiosyncracies I have :) In Haskell, I have a datatype for representing so called terms which looks like: data Term = Var Char | Op Char [Term] i.e. a Term is a variable (denoted by an Int) or an operation (whose name is also denoted by an int), applied to a list of its arguments. For example, f(g(x,y),a(),x) is represented by Op 'f' [Op 'g' [Var 'x',Var 'y'],Op 'a' [], Var 'x] Now, the reason I am writing in D is twofold. First, I want to learn the D language, and second I really need pointers to reduce certain complexities in the operations (Haskell does not have observable sharing).
Dec 26 2013
On Friday, 27 December 2013 at 00:23:58 UTC, Jonathan wrote:I come from Haskell, so please excuse any functional programming idiosyncracies I have :) In Haskell, I have a datatype for representing so called terms which looks like: data Term = Var Char | Op Char [Term] i.e. a Term is a variable (denoted by an Int) or an operation (whose name is also denoted by an int), applied to a list of its arguments. For example, f(g(x,y),a(),x) is represented by Op 'f' [Op 'g' [Var 'x',Var 'y'],Op 'a' [], Var 'x] Now, the reason I am writing in D is twofold. First, I want to learn the D language, and second I really need pointers to reduce certain complexities in the operations (Haskell does not have observable sharing).Could you please clarify the question? I did not understand what you wanted to ask.
Dec 27 2013