Eigenstate: myrddin-dev mailing list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: code review


Hi there,

Some comments:

I think your tn function can be replaced by std.charval, or use
std.intparse with base 16 when deconstructing hex values.

I think your hex type is probably not needed, you can just use
std.option(byte).

I have a feeling this " i<line.len-2; i+=3" should be line.len-3, double
check that you don't have out of bounds there in some cases?

About your comment with inefficiency, you could construct a reverse lookup
hashtable in an __init__ function, but if what you have is performing fine,
i wouldn't worry. Another way to do syl->hex might be a sorted list of
tuples, then use std.bsearch.

Regards,
Andrew Chambers

On Wed, Jun 22, 2016 at 6:32 AM, <a.regenfuss@xxxxxx> wrote:

> Dear fellow myrddin programmers,
>
> first things first: I would like to have a little
> bit of myrddin code reviewed. It is for a small
> utility that converts hexadecimal input to urbit
> syllables and the other way around (urbit is a pretty
> good answer to Utah2000).
>
> Here's the code: https://github.com/pranomostro/syl/blob/master/syl.myr
>
> If I'm wrong here, don't hesitate to send me away.
>
> Thanks in advance.
>
> pranomostro
>

References:
code reviewa.regenfuss@xxxxxx