[Openmcl-devel] Q: Clozure CL and built-in class vs. CLOS class, how to get a CLOS instance from CCL:MAKE-SOCKET?

Rainer Joswig joswig at lisp.de
Fri Jul 5 15:31:36 PDT 2013


Hi,

okay, I read the documentation.

Welcome to Clozure Common Lisp Version 1.8-store-r15418  (DarwinX8664)!
? (apropos "fundamental-tcp")
CCL::FUNDAMENTAL-TCP-STREAM

? (defclass my-stream (CCL::FUNDAMENTAL-TCP-STREAM) ())
#<STANDARD-CLASS MY-STREAM>

? (ccl:make-socket :remote-host "www.apple.com" :remote-port 80 :class 'my-stream)
#<FUNDAMENTAL-TCP-STREAM :ISO-8859-1 (SOCKET/10) #x3020010FE43D>

In above call it returns a CLOS stream of class CCL::FUNDAMENTAL-TCP-STREAM , but I would have expected that it uses the class argument - given the CCL documentation in chapter 10.1.2 .

Is there anything I'm doing wrong?

Regards,

Rainer Joswig









Am 05.07.2013 um 11:51 schrieb Gary Byers <gb at clozure.com>:

> If there were manual sections that answered these questions, I bet that
> they'd be called "10.1.2" and "10.1.3". I suppose that those sections
> could address some aspects of what they discuss more clearly than they
> do, but it'd probably be more productive to ask any remaining questions
> after reading those sections than to not do so ...
> 
> On Fri, 5 Jul 2013, Rainer Joswig wrote:
> 
>> Hi,
>> 
>> 
>> I'm currently using Clozure CL on two types of tiny ARM computers under Linux: Raspberry Pi and Odroid-X2. I have to say, it really rocks. Many thanks for the fantastic ARM port!
>> 
>> While trying to port some code to Clozure CL I was a bit thinking about the following:
>> 
>> If I create a socket with CCL:MAKE-SOCKET , I then get an instance of built-in class CCL::BASIC-TCP-STREAM .
>> 
>> Interestingly enough this built-in class also inherits from a CLOS class CCL::TCP-STREAM, plus two built-in streams.
>> 
>> For the particular functionality I would like to have a CLOS-based TCP-STREAM, so that I can write my own subclass and also can use CHANGE-CLASS.
>> 
>> Now I have the following questions:
>> 
>> * why is CCL::BASIC-TCP-STREAM not a CLOS class? Wouldn't it be more useful for the developer?
>> 
>> * how can I use CCL:MAKE-SOCKET so that it returns a CLOS class?
>> 
>> * are there other easy ways to get a socket as a CLOS class?
>> 
>> 
>> Regards,
>> 
>> Rainer Joswig
>> 
>> 
>> 
>> 
>> _______________________________________________
>> Openmcl-devel mailing list
>> Openmcl-devel at clozure.com
>> http://clozure.com/mailman/listinfo/openmcl-devel
>> 
>> 




More information about the Openmcl-devel mailing list