lfex / lutil

LFE Utility Modules (successor to lfe-utils)
Other
18 stars 8 forks source link

Added (dict?) function. #4

Closed thorgisl closed 9 years ago

thorgisl commented 9 years ago

The new function does what it says: (lutil-type:dict?) checks to see if the provided data is a dict.

Any chance you could merge this soon? (and do a point release) I'm working on an LFE JSON library that needs this functionality ...

rvirding commented 9 years ago

A small comment: you don't actually need the (is_tuple data) test in the guard as it it implicit in the (element 1 data) call. You do not get errors inside a guard, the guard only fails which makes this safe to do. Outside of the guard you might need such a test. The difference in efficiency is very small.

thorgisl commented 9 years ago

@rvirding Oh, very nice. Will update the PR ...

thorgisl commented 9 years ago

Btw, this is the LFE JSON library: https://github.com/thorgisl/ljson

rvirding commented 9 years ago

I think we should start using maps to represent json structures in LFE, it is becoming the norm now. Try looking at the jsxn library, which is built on top of jsx.

On 25 October 2014 21:15, Dreki Þórgísl notifications@github.com wrote:

Btw, this is the LFE JSON library: https://github.com/thorgisl/ljson

— Reply to this email directly or view it on GitHub https://github.com/lfex/lutil/pull/4#issuecomment-60494154.

thorgisl commented 9 years ago

Huh. Those are some very nice libraries ... just added a ticket to dive into that in more detail: https://github.com/thorgisl/ljson/issues/1