-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stream-line-column missing? #12
Comments
Question 1: Who should provide this method, the Gray Streams user code (e.g. the YASON library) or Gray Streams subsystem itself? Reading the Gray Streams proposal text, the wording at first sight makes impression it's the user code responsibility. I am surprised to find this. But for many other cases where default method implementation must be provided by the Gray Streams subsystem the doc explicitly says "The default method ...". The On the other hand, the description says
The Later, in the Discussion section of the doc, we read:
Question 2: If that's a responsibility of the Gray Streams subsystem, does it mean trivial-gray-streams or the underlying Gray Streams in a lisp implementation like CMUCL? Currently trivial-gray-streams only implements methods only for For all other functions we just re-export from the Similarly to I personally see only advantages in having the NIL default method. What reasons could have those people mentioned in the Discussion section of the Gray proposal, who were against the default method for |
I'm not really sure; I've never really used gray streams before. However, it seems useful for trivial-gray-streams to re-export |
Yes, |
Oh, sorry, I didn't notice that it was re-exported. So we're all good here. I don't think trivial-gray-streams needs to define anything. It's up to the user to define a method for Closing issue. Thanks for your help! |
As a portability layer, trivial-gray-steams could shield users from differences in treatment of the Gray proposal by lisp implementations. To avoid cases when a code written and tested on an implementation where the default NIL method exists, suddenly fails on another implementation, as this happened with the YASON library. I will reopen the issue, at least to keep this question more visible for now. |
BTW, regarding this quote from the Gray proposal:
and my question "What reasons could have those people mentioned in the Discussion section of the Gray proposal, who were against the default method for stream-line-column" I guess for STREAM-LISTEN, STREAM-READ-CHAR-NO-HANG the reason is that the default methods are blocking (because implemented in terms of STREAM-READ-CHAR). The reasons for STREAM-START-LINE-P and STREAM-LINE-COLUMN are still unclear to me. Of course, one thing is to not have default methods of these functions, for whatever reasons, and another thing is to sometimes (on some lisp implementations) have them, and sometimes not (on other lisp implementations). Such unpredictable situations is probably worse than clear choice for presence or absence of the default NIL method. It is interesting that of the four functions only STREAM-LINE-COLUMN description is so vague. For the other three, the doc says exactly what is the algorithm of the default method. |
For cmucl, I see that it's implementation defines methods for I think cmucl should provide a method for |
As mentioned in http://www.nhplace.com/kent/CL/Issues/stream-definition-by-user.html,
stream-line-column
must be defined for every character output stream. Perhaps trivial-gray-streams should include a defgeneric for it? There might be other methods that are required; I didn't check. Butstream-start-line-p
says you need to define that orstream-fresh-line
ifstream-line-column
returnsnil
. Don't know how that should be handled.The text was updated successfully, but these errors were encountered: