random-port-state? and random-port? Peter McGoron (04 Jun 2026 13:09 UTC)
Re: random-port-state? and random-port? Wolfgang Corcoran-Mathe (04 Jun 2026 19:11 UTC)
Re: random-port-state? and random-port? Peter McGoron (04 Jun 2026 19:33 UTC)
Re: random-port-state? and random-port? Wolfgang Corcoran-Mathe (05 Jun 2026 01:46 UTC)
Re: random-port-state? and random-port? Peter McGoron (05 Jun 2026 11:51 UTC)

Re: random-port-state? and random-port? Peter McGoron 05 Jun 2026 11:49 UTC

On 6/4/26 21:46, Wolfgang Corcoran-Mathe wrote:
> I think we can leave the definition of 'random-port?' a little
> loose: it might not uniquely identify the ports from its own
> library, but, if it returns true on an object, you can safely apply
> 'random-port-state' to that object.  This may be enough to leave the
> door open for implementations with an "umbrella" random-port type.
> (I'm not entirely sure.)

Yes, that would accommodate that implementation method.

 > One further question I'm now considering is whether 'random-port?'
should be add to the randomized library interface as well.  There are no
accessors there to guard with it, but it would be useful in
implementations that make random ports disjoint from other types.  In
any case, it seems a bit strange for a predicate with such a general
name to appear in only some random port libraries.

This seems less useful, and also prevents the UNIX implementation

     (define (make-random-port)
       (open-binary-input-file "/dev/random"))

-- Peter McGoron