On 9/10/07, skaller <[EMAIL PROTECTED]> wrote:
> On Mon, 2007-09-10 at 00:34 -0700, Erick Tryzelaar wrote:
>
>
> > I think that pretty much covers everything. So, how shall we do ours?
>
> Well, there are lots of things covered by 'filesystem' interaction :)
>
> The right way to search for files is probably using an iterator,
> which is closely related to a stream of strings and/or a channel
> of strings. Filesystem is just another data structure, that
> happens not be in memory.


Yeah thats a good idea. It'd be nice if we had nice sugar to do lazy
lists with support for destructuring through pattern matching. Right
now we'd have to do some semi-ugly things to signify the ends of a
list such as passing in a non-local goto or using option. It'd also be
nice if we could use it as a front end for both generators and
channels.

Oh and there's another appropriate ruby module:

http://www.ruby-doc.org/core/classes/File.html

I do like the interface that ruby presents, and now the dot operator
change we can almost copy that interface.

Dir::foreach "." (proc (d:string) {
  println d;
});

val d:Dir::t = ...;
d.foreach (proc (d:string) {
  println d;
})

You know, we could probably implement ruby's shorthand functions, where this:

{ |x:int, y:string| y + str(x) }

Was equivalent to

gen (x:int, y:string) { ... }

Also, since do-done are already keywords, we could make them
synonymous with braces in this situation, so that we could reduce the
foreach to this, which is much easier to read:

d.foreach do |d:string|
  println d;
done;

I'm just not sure how we handle errors, though.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to