Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pattern match an empty data structure #19

Closed
fogfish opened this issue Jan 29, 2018 · 0 comments
Closed

Pattern match an empty data structure #19

fogfish opened this issue Jan 29, 2018 · 0 comments

Comments

@fogfish
Copy link
Owner

fogfish commented Jan 29, 2018

The library has used {} as empty structure. Recently, structures has been replaces with #queue{} explicit definition. We need a tools (approach) to match empty empty structures in the functions.

e.g.

do_somthing(?empty_queue()) -> ...
@fogfish fogfish added this to the 4.3.0 milestone Jan 31, 2018
fogfish added a commit that referenced this issue Feb 10, 2018
__WHY__
The usage of data structure with tail recursion is easy if
pattern match is used

```
do(?queue()) ->
   % empty

do(#queue{}) ->
   % non empty
```

__WHAT__
Add macros for each data structure.
@fogfish fogfish closed this as completed Feb 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant