From: Robert G. <rpg...@si...> - 2008-11-21 14:29:42
|
Ingvar wrote: > Robert Goldman writes: >> Examining socket-make-stream, I see that its arguments are >> >> (socket &rest args) >> >> The use of &rest is convenient here, since the arguments are simply >> delegated to make-fd-stream with apply. However, it makes the arglist >> prompting from the environment much less useful, and it sends the >> programmer back to make-fd-stream, which is an internal function. >> >> Accordingly, I was wondering if it would be appropriate to change the >> signature of socket-make-stream to >> >> (socket &key input output element-type buffering external-format timeout) >> >> I believe those are the right arguments, but there might be others that >> should be "exported" from make-fd-stream. >> >> There would no longer be the nice, elegant call to apply in >> socket-make-stream; one could just make a normal function call with the >> keyword arguments, but that seems like a small price to pay. But I am >> not a real SBCL developer, only a user, so I bow to the list's feelings >> about this. > > Well, it would be possibe, if you change the signature to: > (socket &rest args &key ...) > as the &REST argument would capture the keywords and they'd still be listed > for user convenience. However, that may well be more confusing than helpful. > This would be an easy and probably benign modification. But all it saves, I believe, is busy work, and if I'm willing to rewrite the code to pass in the keyword arguments one-by-one, that might be best. *Unless* there's some other disadvantage with doing that which has eluded me. That's why I was asking the list. Regards, Robert |