Provide time and regex encoding functions #1

Open
TBBle opened this Issue Jan 11, 2010 · 1 comment

Comments

Projects
None yet
1 participant
@TBBle

TBBle commented Jan 11, 2010

Currently the README for bert.erl specifies that the module user must encode their own date and regexes, but doesn't provide functions to implement the spec for this.

It'd be really handy if a couple of utility functions were included in the bert module for doing this, and maybe even if there was a way to actually tag an already-encoded date or regex so that bert:encode/1 doesn't double-encode it. Maybe simply skipping any tuple that looks like a BERT-encoded time or regex?

I'm not totally sure about this last part, as it seems there's a risk of failing to encode a tuple that happens to look like a date {bert, date, int(), int(), int() } or regex, but I guess that's uncommon enough to not be a problem, given I see no countermeasures against the inverse problem on the decoding side.

@TBBle

This comment has been minimized.

Show comment Hide comment
@TBBle

TBBle Jan 11, 2010

Huh, I just noticed that bert:decode_term/1 doesn't decode regexes or times either. So maybe that should be supported? Depends on the rationale for not having that support in bert:decode_term/1 already.

TBBle commented Jan 11, 2010

Huh, I just noticed that bert:decode_term/1 doesn't decode regexes or times either. So maybe that should be supported? Depends on the rationale for not having that support in bert:decode_term/1 already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment