9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] first capital letter in function names at man pages, why?
@ 2004-05-20 18:42 rog
  2004-05-20 19:21 ` Scott Schwartz
  2004-05-20 20:07 ` [9fans] first capital letter in function names at man pages, why? boyd, rounin
  0 siblings, 2 replies; 8+ messages in thread
From: rog @ 2004-05-20 18:42 UTC (permalink / raw)
  To: 9fans

> you'd better write N parsers.

actually it's not an unreasonable idea to have a regular expression
engine that could work on arbitrary alphabets.
you could express it quite nicely with the new limbo
polymorphism stuff:

	match[T](c: chan of T, p: ref Regex[T]): int for {
		T =>
			eq: fn(t: self T, t1: T): int;
			eof: fn(t: self T): int;
		}

so the alphabet would consist of members of type T, arriving down
channel c, being matched against a previously compiled pattern p.

match would return when it enounters a match, or reads a t such that
t.eof() is true.

then you could write N parsers and just plug 'em in.

i've got something that would allow one to use this kind of stuff
with a shell-like syntax. it's awaiting a bit more of my time...



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-05-21 16:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-20 18:42 [9fans] first capital letter in function names at man pages, why? rog
2004-05-20 19:21 ` Scott Schwartz
2004-05-20 19:51   ` [9fans] limbo polymorphism rog
2004-05-20 20:10     ` Charles Forsyth
2004-05-20 20:07 ` [9fans] first capital letter in function names at man pages, why? boyd, rounin
2004-05-21 14:05   ` rog
2004-05-21 15:12     ` boyd, rounin
2004-05-21 16:25       ` rog

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).