Hacker News new | past | comments | ask | show | jobs | submit login

The email type seems just a smidge too specialized for me. It could more broadly be an "authority" type (borrowing URI/URN terminology) a la:

authority = [userinfo "@"] host [":" port]

The simple extension of allowing a port makes it a more broadly useful type, since authorities like above appear all over the place. Email is just one protocol after all.

There is also a url type, but it is unclear how general it is (just http/s?). There is a cpath type which corresponds to the path in a URI as well.

URI = scheme ":" ["//" authority] path ["?" query] ["#" fragment]

In Rye typing, authority _could_ be the authority described above, and cpath already covers path. The rest are strings as they don't have generically defined syntax.

Perhaps this is a bit of a quibble but it seems to me like if URIs and their structured components (cpath is already there, and email is so close!) were core types rather than just email and url, it opens up a lot of use cases.




Hm. Interesting proposition. Rye inherited email and URL data types from Rebol. I haven't done that much on them specifically, because they aren't that crucial to the design of the language dynamics, so their implementation certainly should be improved (ant thought about).

The idea of making them more general certainly makes sense. Rye is "end-user" focused so it would maybe still be called email. URI-s right now can have different schemes. Scheme defines the kind of url and Rye has generic functions that dispatch on the kind of first argument. So there is:

open file://readme.txt and open sqlite://db.s3db and open postgres://user@localhost/database "pwd" ...

%path/notes.txt is also Rebolism and it's a shorthand for file://path/notes.txt

Thank you. I will think about this

cpath is currently a little specific, at least in behaviour as it's a context path to a word.

Thank you for making this comment. I will think more about it and certanly reread it when I work on there datatypes next time.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: