miekg / learninggo

Learning Go Book in mmark
https://miek.nl/go
Other
539 stars 111 forks source link

Is demo of reverse polish calculator too simple? #57

Open xflcx1991 opened 5 years ago

xflcx1991 commented 5 years ago

In Chapter "Packages",I'm afraid that demo of reverse polish calculator in exercises is too simple.The demo cann't resolve expression like this: 11+22*33*(2+5) .

Now I have completed a work to parse mathematical expression strings by double stack,just the classic “Reverse Polish Notation”.I hope you can accept this PR.

The comment in code is written by Chinese.Does it need to be English?

miekg commented 5 years ago

Looked at your PR, but I'm afraid we need a balance between fully-working and a too long example (there are other really long examples in the doc though).

We could potentially flag this with a test function we add to the book and then leave this as an exercise to the reader (potentially putting the solution in the appendix) ?

WDYT?

xflcx1991 commented 5 years ago

I think you are right.Beginners need simple and workable rather than complex.When someone knows “RPN”, he can write it in any language.

Just close this issue.