Mult
where
parse for App2 Plus
(Vor umstellung auf 2-resultwerte)
Parser fertig

> eval (fst (parse "(P(M23)4)"))
Lit 10
Ziel: variablen
parseeval implementiert

parseval "(P(M23)4)"
(Num 10,"")
variable assignment

*Main Data.Char>parseval "=v2(Mv3)" []
(Num 6,"")
*Main Data.Char>parseval "=x2=y3(Mxy)" []
(Num 6,"")
*Main Data.Char> parseval "(M=x2x=y3y)" []
(Num 6,"")
*Main Data.Char> parseval "=x2(Mx=y(Px1)y)" []
(Num 6,"")
(typ error)
type for assoc
type of parseval
Merge commit '29c7f19a4ba2d43575ffe5a54d5330bda0d0b172'

Conflicts:
	Jaskell/src/Main.hs
(re-add buggy 'call')
functions

parseval "=dFpq{(Mp2)}(d30)" []
(Num 6,"")
nested functions (beware...)

(That was wrong input:
*Main Data.Char> parseval "=dFpq{(Mp=tFxy{2}t00)}(d30)" []
(*** Exception: src/Main.hs:53:8-45: Irrefutable pattern failed for pattern (arg3, ')' : csfinal)
)

*Main Data.Char> parseval "=dFpq{(Mp=tFxy{2}(t00))}(d30)" []
(Num 6,"")
cosmetics; btw: it's lazy

*Main Data.Char> parseval "=dFpq{(Mp=tFxy{2}(t00))}(d3(123))" []
(Num 6,"")
*Main Data.Char> parseval "(123)" []
(*** Exception: src/Main.hs:(24,0)-(27,49): Non-exhaustive patterns in function call
Implement dynamic variables (can do recursion)

*Main Data.Char> parseval "=x2=fFpq{x}(f00)" []
(Num 2,"")
*Main Data.Char> parseval "=fFpq{x}=x2(f00)" []
(Num 2,"")
*Main Data.Char> parseval "=fFx_{(f(Px1)_)}(f10)" []
(<interactive>: out of memory (requested 1048576 bytes)

It's not C:

*Main> parseval "=x1(Px=x2(Px0))" []
(Num 3,"")
*Main> parseval "=x1(P=x2(Px0)x)" []
(Num 3,"")
*Main> parseval "=fFpq{x}=x2(f00)" []
(Num 2,"")
*Main> parseval "=fFpq{x}=x2(P(f00)1)" []
(Num 3,"")
*Main> parseval "=fFpq{x}=x2(P(f00)=x3(f00))" []
(Num 5,"")

No closure:
*Main> parseval "=x2(Fpq{x}__)" []
(Num 2,"")
*Main> parseval "(=x2Fpq{1}__)" []
(Num 1,"")
*Main> parseval "(=x2Fpq{x}__)" []
(*** Exception: Key not found in context
closures!!

*Main> parseval "(=x2Fpq{x}__)" []
(Num 2,"")
*Main> parseval "=x2=fFpq{x}=x3(f00)" []
(Num 2,"")
no dynamic variables

*Main> parseval "=fFpq{x}=x3(f00)" []
(*** Exception: Key not found in context
correct terms