What to call an Arity-1 wget or curl-like function?

I've felt for a while we need something parallel to wget where you just specify a URL! of what you want and it writes it.

Calling it wget or curl would come with expectations that it would have all the options of those programs (I think we could/should make variadic WGET and CURL functions that emulate a useful subset of those options!)

Is there a good name for a simpler arity-1 function that just does the above?

xxx: func [filename [file! url!]] [
    write (second split-path filename) (read filename)
]

How about webget or download?

Download isn't bad.
I can't think of many good options.

write-file-from

In the Repl, DOWNLOAD is currently taken for transferring files to your host system's hard drive... not to the in-browser filesystem. We need something for that.

webget is better than wget...but more generally I'm thinking of this as an arity-1 COPY. So it might not be from the web (a non-web URL!, or just a FILE!).

It's really just an arity-1 function that assumes the target location for a write.

Maybe FETCH ?

1 Like

This is a tricky one. I think the act of writing/saving something to your local machine is a significant decision, so whatever the function name is, I wouldn't want to obscure the fact that it's ultimately a WRITE operation.

FETCH is a decent word. It's commonly used in SQL to paginate results, i.e., you provide it an offset to display result rows X thru Y.

1 Like