There’s nothing going on with the juggling balls at the moment, but I’ve been banging away at Radian with some success. I’ve rewritten the IO system, which now supports both input and output, as well as providing access to the command-line arguments. It’s now at least theoretically possible to write Radian programs that do something useful. It won’t be long now before you’ll be able to read, write, create, delete, and otherwise manipulate files. Shortly after that I will need to spend some time planning the feature set and development timetable for the first release, since it will no longer be obvious what work needs to be done next. This is a pretty exciting phase of the project!
The ski jacket is still on track to be ready for the beginning of ski season. I’ve stitched and taped both sleeves, though now I’m out of seam tape so I won’t be able to get much further until I can drop by Seattle Fabrics for more. Two and a half yards of the three-layer goretex material turned out to be just barely enough; if I did it again I’d probably get an extra quarter yard just to make layout less of a challenge. Working with goretex is an interesting challenge: you can’t poke pins through it because that damages the waterproof membrane. I laid out the pattern using scotch tape, and have been holding the pieces together for stitching with fine silk pins, put through about an eighth of an inch of fabric in the seam allowance. It doesn’t matter if there are holes in the seam allowance, since I’m going to cut most of it off and seal it with seam tape anyway. At least the fabric doesn’t fray, since the top and bottom layers are bonded to the goretex membrane.
Hi Mars! I downloaded Radian today to try to make a simple piped in data-transforming program, and I couldn’t figure out how to do anything nontrivial. I read through the library/*.radian files, but they were only moderately helpful. Some questions (possibly food for a more extended example program?):
– How do you access piped data?
– How do you use input()?
– How do you write a function which performs IO? (do you have to return the io object?)
Also, I got a fair number of failed assertions while blundering around which I would happily report if it was helpful.
Comment by Asher — November 16, 2010 @ 8:24 pm
Hi! Thanks for trying it out. I’d like eventually to include an “examples” directory; for the time being, take a look at the validation/suite/ directory for some code samples.
Piped data:
io->input()
reads from stdin,io->print()
writes to stdout. Both are delimited by newlines; there’s no way to do non-line-oriented IO.The argument to
io->input
is a function reference – in RB terms, a delegate. Here is a simple, untested program which would echo one line of input to its output:function echo(io, stuff):
io->print(stuff)
result = io
end echo
io->input( capture(foo, bar: echo(foo, bar)) )
capture
is Radian’s lambda operator: it defines parameters, then captures the expression which follows the colon as a function reference (equivalent to an RB delegate). Input expects to receive a reference to a function whose first parameter is io and second parameter is the line received from input.This is clearly very cumbersome; I plan to reduce the pain by implementing something like Ruby’s blocks or C#/VB.NET’s async methods. For the moment I’m afraid input statements are going to be rather a mess.
I would be very happy to hear about the failed assertions you found, especially if you have code samples which reproduce them. I was looking into Trac earlier; it is about time to set up some kind of issue tracking system.
Comment by Mars Saxman — November 16, 2010 @ 11:05 pm
Thanks, this makes sense. I will give my program another try and see how it goes (I’ll email you bug reports until you have Trac or something up and running).
I haven’t really used RB in years, though; C++ or Objective-C analogies would be more helpful in general =)
Comment by Asher — November 17, 2010 @ 9:49 am
Thanks. You might want to update your repo, by the way: I pushed a pretty substantial fix to the string type last night, which eliminates a number of assertion failures that occurred when attempting to iterate over characters.
I haven’t implemented the UTF-8 decoder yet, so
input
is ASCII-only.Comment by Mars Saxman — November 17, 2010 @ 10:21 am