Re: [Factor-talk] Code Check and UI request

2014-12-12 Thread Mark Green
Thanks. I've worked out a few of the basics of how bitstreams works but I'm not sure about the whole thing.. I do have another bit of code that I'd be very grateful if folks could look at and tell me if it could be done better, because I'm really not used to this language at all! Also, is there

Re: [Factor-talk] Code Check and UI request

2014-12-12 Thread John Benediktsson
Hi Mark, Just a couple comments: Those buttons are border buttons: IN: scratchpad The Label [ the action print ] border-button gadget. (also note the use of gadget. for displaying a gadget inline with the listener, kinda neat way to test UI stuff) Your code looks pretty nice, I would

Re: [Factor-talk] Code check and UI request

2014-12-11 Thread Mark Green
Hi, Wow, thanks very much for your help! I only just noticed that there is already a bitstreams library, but is there some further documentation for it somewhere? The online documentation only shows the prototypes and the link to the -docs.factor file goes to a dead github page. Mark

Re: [Factor-talk] Code check and UI request

2014-12-11 Thread John Benediktsson
You can look at the code directly, or the -tests for examples of usage. https://github.com/slavapestov/factor/blob/master/basis/bitstreams/bitstreams-tests.factor We always link to -docs (even if it doesn't exist, like in this case). It would be good to add some documentation for it. On Thu,

[Factor-talk] Code check and UI request

2014-12-10 Thread Mark Green
Hi Folks, I recently had a go at writing a Factor object to pull bitstrings of arbitrary length from a bytearray. Since I'm still a bit of a newbie, could you give any commentary on the coding or the style and how it could be improved? USING: kernel locals accessors math sequences math.bitwise ;

Re: [Factor-talk] Code check and UI request

2014-12-10 Thread John Benediktsson
Hi Mark, I did some quick cleanup without really trying to change any of your algorithm or anything here, you can scroll to the bottom for the cleanest one: http://paste.factorcode.org/paste?id=3409 Using locals is nice when it makes writing code quickly, but over time you'll find ways to