Peer review of simple_cache inplementation

18 views
Skip to first unread message

Eric Bailey

unread,
Aug 17, 2015, 11:55:18 AM8/17/15
to Lisp Flavoured Erlang
Last night, I ported the simple_cache example from chapter 6 of Erlang and OTP in Action to LFE. Since I'm still new to "real" Erlang/LFE programming, i.e. full-fledged OTP apps instead of simple functional examples, I'd love some peer review.

If you have a minute, please look over the code and start discussions as you see fit in the issues.



Cheers,
Eric

Duncan McGreggor

unread,
Aug 17, 2015, 12:05:36 PM8/17/15
to Lisp Flavoured Erlang
Looks good to me! The only thing I would add is the convenience function simple_cache:start/0 that does (application:start 'simple_cache) so that I could run this easily with lfe -s simple_cache.

Stylistically, I might change the main module to simple-cache.lfe since only the app.src needs to match the directory name when running from the directory (i.e., not running in a release).

Great job!

d

P.S. This would be a good LFE blog post, especially if you could share with readers any of your experiences when writing this -- what was awesome, what sucked, where you overcame difficulties or surmounted conceptual obstacles, etc. Wouldn't have to be long, either :-)

--
You received this message because you are subscribed to the Google Groups "Lisp Flavoured Erlang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lisp-flavoured-e...@googlegroups.com.
To post to this group, send email to lisp-flavo...@googlegroups.com.
Visit this group at http://groups.google.com/group/lisp-flavoured-erlang.
For more options, visit https://groups.google.com/d/optout.

Eric Bailey

unread,
Aug 17, 2015, 12:50:48 PM8/17/15
to Lisp Flavoured Erlang
Thanks for your feedback! I've incorporated your suggestions and added a screenshot of running lfe (-pa ebin) -s simple-cache.

Re: blog post. I have to crank out some Swift for the time being, but when I inevitably need a break, I'll try to whip something up. org-mode + ox-gfm = win.

Eric Bailey

unread,
Aug 18, 2015, 1:57:53 AM8/18/15
to lisp-flavo...@googlegroups.com
I kind of feel like should contact the authors and make sure it's ok. Do you guys think that's necessary or are attribution and links enough?


Eric

Duncan McGreggor

unread,
Aug 18, 2015, 2:39:02 AM8/18/15
to Lisp Flavoured Erlang
From the book:

This book is here to help you get your job done. In general, you may use the code in this book in your programs and documentation. You do not need to contact us for permission unless you’re reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing a CD-ROM of examples from O’Reilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your product’s documentation does require permission.

We appreciate, but do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN. For example: “Book Title by Some Author (O’Reilly). Copyright 2011 Some Copyright Holder, 9781449373191.”

If you feel your use of code examples falls outside fair use or the permission given above, feel free to contact us at permi...@oreilly.com.


Reply all
Reply to author
Forward
0 new messages