Re: code review
[Thread Prev] | [Thread Next]
- Subject: Re: code review
- From: Andrew Chambers <andrewchamberss@xxxxxxxxx>
- Date: Wed, 22 Jun 2016 10:59:23 +1200
- To: a.regenfuss@xxxxxx
- Cc: myrddin-dev@xxxxxxxxxxxxxx
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 >
code review | a.regenfuss@xxxxxx |
- Prev by Date: code review
- Next by Date: Re: code review
- Previous by thread: code review
- Next by thread: Re: code review
- Index(es):