Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INFO? on URL! doesn't do anything #33

Open
gchiu opened this issue Mar 21, 2019 · 2 comments
Open

INFO? on URL! doesn't do anything #33

gchiu opened this issue Mar 21, 2019 · 2 comments
Assignees
Labels
wish New feature or request

Comments

@gchiu
Copy link
Collaborator

gchiu commented Mar 21, 2019

info? should return an object! containing details of a file but it does nothing so presumably has not been defined yet.

I guess it should really also be info-of

>> ‌info? http://metaeducation.s3.amazonaws.com/travis-builds/0.3.40/r3-3ffb63e-debug.exe
;  null 
@hostilefork hostilefork added the wish New feature or request label Mar 21, 2019
@hostilefork hostilefork changed the title head doesn't do anything INFO? on URL! doesn't do anything Mar 21, 2019
@hostilefork
Copy link
Owner

hostilefork commented Mar 21, 2019

We can presumably implement something in terms of an HTTP HEAD operation, here.

Whether that returns an OBJECT! or a BLOCK! or a MAP!...I don't know. But it seems to me that web programmers would likely find it most useful if the names of the fields matched directly.

For Rebol operations (like historical INFO? in Rebol2) that return fields in schemas defined by Rebol, I've been thinking we should be avoiding that:

>> mold info? script.reb
== {make object! [
    size: 1144
    date: 19-May-2018/17:38:25-4:00
    type: 'file
]}

It seems to me to have more value in the near term--even in the desktop version--to be going toward web standards for the returned objects. I grant it may be possible to invent a more succinct system than what the HTTP protocol has, and size may seem like a better name than content-length on the surface. But whatever invention you make that's different from that is still an invention, requires its own documentation and justification, etc.

You can't make everything better in a meaningful way just by doing one day's work, and if you're going to challenge any one little thing like MIME types--that is a battle for making measurable improvements that would take one person years--and that would be if that's the only thing they did.

I guess it should really also be INFO-OF

The naming conventions for such things don't have a general solution. But I definitely do think that the ? convention needs to mean something. "returns a value" is not a useful convention. While I like LENGTH OF and TYPE OF, I'm wary of extending that approach to "generics" for basic words like "info". Though I can't say exactly the limits where these ideas move from good to bad.

If we're going to be boring, then in OOP languages they have some kind of namespacing, so you'd say http/head ... or http/get-info or something like that.

If we're going to be interesting, then it's years of research. Naming ties in with big design points of meta-object systems, which are something that I think we aren't going to be solving in this particular iteration of the project.

(What I hope is that enough potential in the evaluator to get people smart people to come work on all that. When you've got thousands of open issues with no resolution, it's going to take a village. Or a planet. Or something.)

@gchiu
Copy link
Collaborator Author

gchiu commented Mar 21, 2019

I want to return the enough detail to provide a link to the binaries for a platform so whatever HEAD does is fine. So, just map info? to the JS head function whatever it's called.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wish New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants