jlouis / positive

Check if a term is positive
MIT License
13 stars 3 forks source link

Implement a gen_server for positive numbers #3

Open jlouis opened 8 years ago

jlouis commented 8 years ago

The subject says it all.

Licenser commented 8 years ago

I think a FSM is a better approach here:

┌─────────┐                              
│         │                              
│ waiting │───put────┬─────────────┐     
│         │          │             │     
└─────────┘          │             │     
     ▲               │             │     
     │               │             │     
     │               ▼             ▼     
     │          ┌─────────┐   ┌─────────┐
     │          │         │   │         │
     │          │positive │   │negative │
     │          │         │   │         │
     │          └─────────┘   └─────────┘
     │               │             │     
     │               │             │     
     └───────────────┴──get────────┘     
jlouis commented 8 years ago

I think if we are to do this, we should build a project which uses this as a dependency. There is no reason to bind the things into one big system when you can decouple them into two modules. The same is true with #4 which ought to be yet.

Licenser commented 8 years ago

You are are absolutely right, in that sense positive should only have a single function.