Type | Bug | Status | submitted | Date | 7-Apr-2013 05:14 |
---|---|---|---|---|---|
Version | r3 master | Category | Unspecified | Submitted by | fork |
Platform | All | Severity | minor | Priority | normal |
Summary | Make native ports give nicer messages when probed or errors thrown |
---|---|
Description |
I noticed that there is a "native port" inside of the TCP scheme as an "actor". actor: make native! [[port!]] It does not respond in a nice way to probing. It says "Access error: invalid port object (invalid field values). It does the same thing for type inquiries. It would be nice if type? and probe did something that wasn't an error, but rather a nice friendly "internal!" kind of answer that didn't look like a bug. But even "Access error: internal port! objects are not to be touched or looked at" would be a start. Haven't looked into the internals to know what's feasible. |
Example code |
>> foo: open tcp://10.20.03.04 >> probe foo/scheme/actor ** Access error: invalid port object (invalid field values) ** Where: actor ** Near: foo/scheme/actor >> type? foo/scheme/actor ** Access error: invalid port object (invalid field values) ** Where: actor ** Near: foo/scheme/actor |
Assigned to | n/a | Fixed in | - | Last Update | 7-Apr-2013 09:46 |
---|
Comments | |
---|---|
(0003801)
abolka 7-Apr-2013 05:32 |
The ACTOR is a native!, which is a function type. So what you are doing in your example code is calling this actor function. Compare the following:
>> foo: func [] [print "bar" 42] >> probe foo "bar" 42 == 42 >> type? foo == integer! This invokes FOO as part of gathering the arguments for PROBE or TYPE?. If you don't want to call FOO, you have to use a get-word: >> type? :foo == function! You can do the same for the native actors, with get-paths: >> type? :system/schemes/tcp/actor == native! |
(0003802)
rebolek 7-Apr-2013 09:46 |
To get informations about port, you have to QUERY it.
>> QUERY port |
Date | User | Field | Action | Change |
---|---|---|---|---|
7-Apr-2013 09:46 | rebolek | Comment : 0003802 | Added | - |
7-Apr-2013 05:33 | abolka | Comment : 0003801 | Modified | - |
7-Apr-2013 05:32 | abolka | Comment : 0003801 | Added | - |
7-Apr-2013 05:15 | fork | Description | Modified | - |
7-Apr-2013 05:15 | fork | Code | Modified | - |
7-Apr-2013 05:14 | fork | Ticket | Added | - |