# Non-Network related schemes and URLs

**URL:** <https://revolt.metaeducation.com/forum/t/non-network-related-schemes-and-urls/1506>\
**Category:** Naming\
**Created:** [February 13, 2021, 5:54am UTC](https://revolt.metaeducation.com/forum/t/non-network-related-schemes-and-urls/1506 "2021-02-13T05:54:39Z")\
**Posts on this page:** 8\
**Page:** 2

<div class="post-metadata">

**Author:** ![rgchris](https://revolt.metaeducation.com/forum/user_avatar/revolt.metaeducation.com/rgchris/32/14_2.png) [@rgchris](https://revolt.metaeducation.com/forum/u/rgchris)\
**Post date:** [February 15, 2021, 1:39am UTC](https://revolt.metaeducation.com/forum/t/non-network-related-schemes-and-urls/1506/21 "2021-02-15T01:39:42Z")

</div>

> [@hostilefork](#):
>
> When does the universal generic verb of READ stop accruing this potentially giant list of refinements?

I haven't proposed any new ones. I'd be happy to pare back the semantics of READ (in particular) and push them to the state of a given port.

> [@hostilefork](#):
>
> Breaking things into lines seems like something that could be handled by a fallback if the actor didn't have its own optimized/streaming implementation. How should that work?

Or could be handled in the generic for any character if it detected it in the stream. This is a spitball:

```plaintext
p: make port! streaming://thing
p/options/break: newline
collect [
    while [not empty? p] [
        keep read p
    ]
]

```

I don't have the answers for how EMPTY? works on streaming ports, but again, it doesn't seem a showstopper.

> [@hostilefork](#):
>
> Do actors have the ability to "contribute" more refinements, or are changes managed purely by being compiled into the core?

Conceptually I don't see why not, I'd put that back to you—how would you do that? This'd be a question of mapping one function to another. Alternatively, is there a natural language limit to the appropriate refinements for a given verb? Given that you can always use a block as currency for most of these verbs, what reasoning would there be not to use a dialect if you extend past limitations set by applicability on regular Rebol values? Another way to put this is why do these high-value verbs have such specific refinements?

> [@hostilefork](#):
>
> How would these make it through to HELP if they exist?

HELP is such a big, hacky function as it is. There'd be a way.

> [@hostilefork](#):
>
> While the implementations may vary, it seems you at least think there is some agreed-upon arity for every word. And you think there's a good first draft of this list. I guess going over the list and explaining why--since these words can semantically mean literally anything--they have the given arity is at least ground zero for the religion.

I compiled [this list](https://github.com/r3n/rebol-wiki/wiki/Port-Actors) a while ago. I don't treat this list as sacred in any way, it was just an enumeration from R3/Alpha (categorization mine).

---

<div class="post-metadata">

**Author:** ![rgchris](https://revolt.metaeducation.com/forum/user_avatar/revolt.metaeducation.com/rgchris/32/14_2.png) [@rgchris](https://revolt.metaeducation.com/forum/u/rgchris)\
**Post date:** [February 15, 2021, 2:00am UTC](https://revolt.metaeducation.com/forum/t/non-network-related-schemes-and-urls/1506/22 "2021-02-15T02:00:18Z")

</div>

> [@rgchris](#):
>
> I don't have the answers for how EMPTY? works on streaming ports, but again, it doesn't seem a showstopper.

One general way to approach streaming is that it be event-driven and that a limited number of events be configurable. In a way, that's kind of what Parse Machine is, but I'm only really at an early understanding of what the mechanics of that are and how tightly you could couple it to a streaming spigot.

The only such spigots we have right now (that I'm aware of) are FILE and TCP schemes. I'd love to know specifically what Earl had in mind for a CALL scheme.

---

<div class="post-metadata">

**Author:** ![hostilefork](https://revolt.metaeducation.com/forum/user_avatar/revolt.metaeducation.com/hostilefork/32/421_2.png) [@hostilefork](https://revolt.metaeducation.com/forum/u/hostilefork)\
**Post date:** [February 15, 2021, 2:04am UTC](https://revolt.metaeducation.com/forum/t/non-network-related-schemes-and-urls/1506/23 "2021-02-15T02:04:46Z")

</div>

> [@rgchris](#):
>
> ```
> db: open some://dbms/scheme
> select db [* from table-x]
> change db [foo: "y" in table-y]
> 
> ```
> 
> To me, that is coherent.

What if I didn't OPEN it, but tried to use the URL directly?

```
change some://dbms/scheme [foo: "y" in table-y]

```

How would that be resolved with any behavior for what CHANGE might do for a string?

This brings up again how PORT! may claim to be an ANY-CONTEXT!. But operations like APPEND and FIND can't act like they do on OBJECT! -and- dispatch to the port scheme to do its thing. It has to be one or the other.

So how do you talk to the object of a port's implementation vs. send messages to the thing the port is representing?

---

<div class="post-metadata">

**Author:** ![rgchris](https://revolt.metaeducation.com/forum/user_avatar/revolt.metaeducation.com/rgchris/32/14_2.png) [@rgchris](https://revolt.metaeducation.com/forum/u/rgchris)\
**Post date:** [February 15, 2021, 2:15am UTC](https://revolt.metaeducation.com/forum/t/non-network-related-schemes-and-urls/1506/24 "2021-02-15T02:15:01Z")

</div>

> [@hostilefork](#):
>
> What if I didn't OPEN it, but tried to use the URL directly?

Could also do MAKE PORT!

> [@hostilefork](#):
>
> ```plaintext
> change some://dbms/scheme [foo: "y" in table-y]
> 
> ```
> 
> How would that be resolved with any behavior for what CHANGE might do for a string?

If strings generated directly from source are locked, then you'll get an error 😃

Isn't that slightly problematic anyway? This could come back to bite me, but how common is using a block to amend a string with insert/change/append?

I still lean toward having to explicitly transform a URL to a port ( **make port!** or **open** ) before acting on it as such. READ/WRITE would seem to be the exceptions to that. Being able to manipulate the URL as a series is still essential of itself.

> [@hostilefork](#):
>
> So how do you talk to the object of a port's implementation vs. send messages to the thing the port is representing?

I wouldn't propose changing that—path notation gets you the top level of the port object, verbs access the API.

```plaintext
>> this: make port! http://foo
== #[port! [...] [...]]

>> help this
THIS is a port! of value:
   spec object! [title scheme ref path host port-id local-id ...
   scheme object! [name title spec info actor awake]
   actor object! [read write open reflect close copy query]
   awake blank! _
   state blank! _
   data blank! _
   locals blank! _
   connections blank! _

>> this/spec 
== make object! [
    [title scheme ref path host port-id local-id method headers content timeout debug follow]
    [
        title: "HyperText Transport Protocol v1.1"
        scheme: 'http
        ref: http://foo
        path: %/
        host: "foo"
        port-id: 80
        local-id: _
        method: get
        headers: []
        content: _
        timeout: 15
        debug: _
        follow: redirect
    ]
]

```

---

<div class="post-metadata">

**Author:** ![rgchris](https://revolt.metaeducation.com/forum/user_avatar/revolt.metaeducation.com/rgchris/32/14_2.png) [@rgchris](https://revolt.metaeducation.com/forum/u/rgchris)\
**Post date:** [February 15, 2021, 10:38pm UTC](https://revolt.metaeducation.com/forum/t/non-network-related-schemes-and-urls/1506/25 "2021-02-15T22:38:41Z")

</div>

> [@BlackATTR](#):
>
> I'm not a big fan of the colon notation `storage:key` bec I more naturally associate a colon with an assignment operator.

On reflection, URLs can be a bit of a red herring in these cases. Yes, I can spec with minimalist syntax, say **log::error** or **clipboard::general** , but that could be a minor quibble if all you're doing is establishing those places. As with the HTTPd scheme (or most schemes), you can also initiate with a freeform block that only needs **[scheme: 'thing ...]** at the lead.

If these are essential services, they could live in a word by themselves and thus become accessible via regular syntax:

```plaintext
; in a startup script/beginning of script
log: reduce [
    'log make port! log:type=log
    'info make port! [scheme: 'log "log"] ; spitball alternate
    'warn make port! log:type=warn
    'error make port! log:type=error
]

clipboard: make port! clipboard://

; then when you look to use them
write log/error "Some error message"
write clipboard "Text I want to paste elsewhere"

```

You still get the benefit of having top-level verbs and descriptive nouns. You no longer have the string conflict either:

```plaintext
insert clipboard image
insert log/error "Message"

```

For local storage, it could have more of a map!-like interface:

```plaintext
storage: reduce [
    'local open storage::local ; localStorage object
    'session open storage::session ; sessionStorage object
]

; then we can switch to using SELECT/PUT
select storage/local "thing"
put storage/session "thing" "just for now"

```

Does that read a little better?

* * *

memo: PUT should allow PORT! for its series argument, and be added to the actors list—although: is PUT just a synonym for POKE?

---

<div class="post-metadata">

**Author:** ![BlackATTR](https://revolt.metaeducation.com/forum/user_avatar/revolt.metaeducation.com/blackattr/32/204_2.png) [@BlackATTR](https://revolt.metaeducation.com/forum/u/BlackATTR)\
**Post date:** [February 15, 2021, 11:14pm UTC](https://revolt.metaeducation.com/forum/t/non-network-related-schemes-and-urls/1506/26 "2021-02-15T23:14:00Z")

</div>

I think that this looks more like rebol syntax. 👍

---

<div class="post-metadata">

**Author:** ![rgchris](https://revolt.metaeducation.com/forum/user_avatar/revolt.metaeducation.com/rgchris/32/14_2.png) [@rgchris](https://revolt.metaeducation.com/forum/u/rgchris)\
**Post date:** [February 16, 2021, 8:03pm UTC](https://revolt.metaeducation.com/forum/t/non-network-related-schemes-and-urls/1506/27 "2021-02-16T20:03:57Z")

</div>

There should thus be a policy for handling HELP reflection—

```plaintext
help clipboard

```

Should likely print a descriptor of the port and permitted actors with individual descriptors

---

<div class="post-metadata">

**Author:** ![BlackATTR](https://revolt.metaeducation.com/forum/user_avatar/revolt.metaeducation.com/blackattr/32/204_2.png) [@BlackATTR](https://revolt.metaeducation.com/forum/u/BlackATTR)\
**Post date:** [February 21, 2021, 11:43pm UTC](https://revolt.metaeducation.com/forum/t/non-network-related-schemes-and-urls/1506/28 "2021-02-21T23:43:02Z")

</div>

> [@rgchris](#):
>
> Absolutely not borrowing from Java—I resent the insinuation 😜.

Retracted. 🙂 It's perhaps more commonly known as the notation for pseudo-elements in CSS.

```plaintext
p::first-line { }

```

[Previous page](https://revolt.metaeducation.com/forum/t/non-network-related-schemes-and-urls/1506.md?page=1)
