From avodonosov at yandex.ru Mon Jan 27 11:53:49 2014 From: avodonosov at yandex.ru (Anton Vodonosov) Date: Mon, 27 Jan 2014 15:53:49 +0400 Subject: a question sbcl integration In-Reply-To: <7877E311-2EE3-46E9-98F6-DB498932E86A@setf.de> References: <7877E311-2EE3-46E9-98F6-DB498932E86A@setf.de> Message-ID: <149651390823629@web2g.yandex.ru> 27.01.2014, 15:51, "james anderson" : > good afternoon; > > what was the intent with respect to the implementation for stream- > file-position present in sbcl? > the trivial-gray-streams package definition is clear to distinguish > symbols and the mixins file defines methods on the respective sb-gray > symbol, but there is nothin apparent to serve to delegate from the > trivial-gray-streams function to the sb-gray operator. > > how was this intended to work? > > best regards, from berlin, trivial-gray-streams:stream-file-position and sb-gray:stream-file-position is the same symbol. Trivial-gray-streams just re-exports it, there is now separate function. From james.anderson at setf.de Mon Jan 27 12:37:44 2014 From: james.anderson at setf.de (james anderson) Date: Mon, 27 Jan 2014 13:37:44 +0100 Subject: a question sbcl integration In-Reply-To: <176591390823918@web2g.yandex.ru> References: <7877E311-2EE3-46E9-98F6-DB498932E86A@setf.de> <149651390823629@web2g.yandex.ru> <176591390823918@web2g.yandex.ru> Message-ID: <3FDE3D37-982D-4817-903E-8DE37CAD31DC@setf.de> On 27 Jan 2014, at 12:58 PM, Anton Vodonosov wrote: > 27.01.2014, 15:53, "Anton Vodonosov" : >> 27.01.2014, 15:51, "james anderson" : >> >>> good afternoon; >>> >>> what was the intent with respect to the implementation for stream- >>> file-position present in sbcl? >>> the trivial-gray-streams package definition is clear to distinguish >>> symbols and the mixins file defines methods on the respective sb-gray >>> symbol, but there is nothin apparent to serve to delegate from the >>> trivial-gray-streams function to the sb-gray operator. >>> >>> how was this intended to work? >>> >>> best regards, from berlin, >> >> trivial-gray-streams:stream-file-position and sb-gray:stream-file-position >> is the same symbol. Trivial-gray-streams just re-exports it, there is now >> separate function. > > Ignore the above response. > i did. > See the definition of method for sb-gray:stream-file-position > in the stream.lisp, under the #+sbcl > >>> but there is nothin apparent to serve to delegate from the >>> trivial-gray-streams function to the sb-gray operator. > > Note, that it works other way around, from sb-gray to trivial-gray-streams: > > cl:file-position calls sb-gray:stream-file-position. > We define a method for it on our stream class; > and this method calls trivial-gray-streams:stream-file-position. > i would understand this to require that, in order to have a complete interface, the application is supposed to use some symbols from sb-gray and some from trivial-gray-streams. is that the intent? From james.anderson at setf.de Mon Jan 27 17:00:41 2014 From: james.anderson at setf.de (james anderson) Date: Mon, 27 Jan 2014 18:00:41 +0100 Subject: a question sbcl integration In-Reply-To: <20140127155246.GA17596@radon> References: <7877E311-2EE3-46E9-98F6-DB498932E86A@setf.de> <149651390823629@web2g.yandex.ru> <176591390823918@web2g.yandex.ru> <3FDE3D37-982D-4817-903E-8DE37CAD31DC@setf.de> <20140127155246.GA17596@radon> Message-ID: <67AE8B82-A346-4920-9D05-FA054C29ADA7@setf.de> good evening; On 27 Jan 2014, at 4:52 PM, David Lichteblau wrote: > Quoting james anderson (james.anderson at setf.de): >>> Note, that it works other way around, from sb-gray to trivial-gray-streams: >>> >>> cl:file-position calls sb-gray:stream-file-position. >>> We define a method for it on our stream class; >>> and this method calls trivial-gray-streams:stream-file-position. >> >> i would understand this to require that, in order to have a complete >> interface, the application is supposed to use some symbols from >> sb-gray and some from trivial-gray-streams. >> is that the intent? > > The idea is that if given a stream of an arbitrary class, its position > can be queried or set using cl:file-position, and when implementing a > stream, the mixin allows the author to merely specialize > tgs:stream-file-position and (setf tgs:stream-file-position) on that > class. ok. this asymmetry was not clear to me. i tend to use stream- operators directly, which led to the problem with stream-file-position. my patch was to add a delegating default method from the t-g-s operator to that of the base implementation, in this case sbcl, but at least i now understand what you intended. > > Neither user nor stream implementor should have to be aware of the call > site in sb-gray. > > This trivial-gray-streams way of doing things never felt absolutely ideal > and clean to me, but was the best compromise I could come up with. best regards, from berlin, From david at lichteblau.com Mon Jan 27 15:52:47 2014 From: david at lichteblau.com (David Lichteblau) Date: Mon, 27 Jan 2014 17:52:47 +0200 Subject: a question sbcl integration In-Reply-To: <3FDE3D37-982D-4817-903E-8DE37CAD31DC@setf.de> References: <7877E311-2EE3-46E9-98F6-DB498932E86A@setf.de> <149651390823629@web2g.yandex.ru> <176591390823918@web2g.yandex.ru> <3FDE3D37-982D-4817-903E-8DE37CAD31DC@setf.de> Message-ID: <20140127155246.GA17596@radon> Quoting james anderson (james.anderson at setf.de): > > Note, that it works other way around, from sb-gray to trivial-gray-streams: > > > > cl:file-position calls sb-gray:stream-file-position. > > We define a method for it on our stream class; > > and this method calls trivial-gray-streams:stream-file-position. > > i would understand this to require that, in order to have a complete > interface, the application is supposed to use some symbols from > sb-gray and some from trivial-gray-streams. > is that the intent? The idea is that if given a stream of an arbitrary class, its position can be queried or set using cl:file-position, and when implementing a stream, the mixin allows the author to merely specialize tgs:stream-file-position and (setf tgs:stream-file-position) on that class. Neither user nor stream implementor should have to be aware of the call site in sb-gray. This trivial-gray-streams way of doing things never felt absolutely ideal and clean to me, but was the best compromise I could come up with. d. From james.anderson at setf.de Mon Jan 27 11:44:24 2014 From: james.anderson at setf.de (james anderson) Date: Mon, 27 Jan 2014 12:44:24 +0100 Subject: a question sbcl integration Message-ID: <7877E311-2EE3-46E9-98F6-DB498932E86A@setf.de> good afternoon; what was the intent with respect to the implementation for stream- file-position present in sbcl? the trivial-gray-streams package definition is clear to distinguish symbols and the mixins file defines methods on the respective sb-gray symbol, but there is nothin apparent to serve to delegate from the trivial-gray-streams function to the sb-gray operator. how was this intended to work? best regards, from berlin, From avodonosov at yandex.ru Mon Jan 27 15:58:09 2014 From: avodonosov at yandex.ru (Anton Vodonosov) Date: Mon, 27 Jan 2014 19:58:09 +0400 Subject: a question sbcl integration In-Reply-To: <3FDE3D37-982D-4817-903E-8DE37CAD31DC@setf.de> References: <7877E311-2EE3-46E9-98F6-DB498932E86A@setf.de> <149651390823629@web2g.yandex.ru> <176591390823918@web2g.yandex.ru> <3FDE3D37-982D-4817-903E-8DE37CAD31DC@setf.de> Message-ID: <400041390838289@web22h.yandex.ru> 27.01.2014, 19:41, "james anderson" : > i would understand this to require that, in order to have a complete interface, > the application is supposed to use some symbols from sb-gray and some from trivial-gray-streams. > is that the intent? No, only trivial-gray-streams package is used by stream implementors. For example, you want to create your own stream: (declass my-stream (trivial-gray-streams:fundamental-character-output-stream) (?)) (defmethod trivial-gray-streams:stream-write-char ((stream my-stream) ...) ?) (defmethod trivial-gray-streams:stream-start-line-p ((stream my-stream) ...)?) (defmethod trivial-gray-streams:stream-write-string ((stream my-stream) ...)?) ;; and all other methods Then my-stream may be passed to any code using standard CL functions: (let ((s (make-instance 'my-stream ?))) (cl:format s "hello ~A~%" "world")) What are you trying to do? Do you have specific problem with SBCL? Best regards, - Anton From avodonosov at yandex.ru Mon Jan 27 11:58:38 2014 From: avodonosov at yandex.ru (Anton Vodonosov) Date: Mon, 27 Jan 2014 15:58:38 +0400 Subject: a question sbcl integration In-Reply-To: <149651390823629@web2g.yandex.ru> References: <7877E311-2EE3-46E9-98F6-DB498932E86A@setf.de> <149651390823629@web2g.yandex.ru> Message-ID: <176591390823918@web2g.yandex.ru> 27.01.2014, 15:53, "Anton Vodonosov" : > 27.01.2014, 15:51, "james anderson" : > >> ?good afternoon; >> >> ?what was the intent with respect to the implementation for stream- >> ?file-position present in sbcl? >> ?the trivial-gray-streams package definition is clear to distinguish >> ?symbols and the mixins file defines methods on the respective sb-gray >> ?symbol, but there is nothin apparent to serve to delegate from the >> ?trivial-gray-streams function to the sb-gray operator. >> >> ?how was this intended to work? >> >> ?best regards, from berlin, > > trivial-gray-streams:stream-file-position and sb-gray:stream-file-position > is the same symbol. Trivial-gray-streams just re-exports it, there is now > separate function. Ignore the above response. See the definition of method for sb-gray:stream-file-position in the stream.lisp, under the #+sbcl >> but there is nothin apparent to serve to delegate from the >> ?trivial-gray-streams function to the sb-gray operator. Note, that it works other way around, from sb-gray to trivial-gray-streams: cl:file-position calls sb-gray:stream-file-position. We define a method for it on our stream class; and this method calls trivial-gray-streams:stream-file-position.