Custom textual output port not recognized as a textual port

Bug #175517 reported by Derick Eddington
2
Affects Status Importance Assigned to Milestone
Ikarus Scheme
Fix Released
Medium
Abdulaziz Ghuloum

Bug Description

Ikarus Scheme version 0.0.2patched+ (revision 1222, build 2007-12-11)
Copyright (c) 2006-2007 Abdulaziz Ghuloum

> (define ctop
    (make-custom-textual-output-port
      "ctop"
      (lambda (str start count)
        (printf "*** (write! ~s)\n" (substring str start (+ start count)))
        count)
      #f #f #f))
> (write 'blah ctop)
*** (write! "blah")
> (newline ctop)
Unhandled exception
 Condition components:
   1. &error
   2. &who: newline
   3. &message: "not a textual port"
   4. &irritants: (#<output-port "ctop">)
>

Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote :

Fixed in revision 1223. Thanks.

> (define ctop
    (make-custom-textual-output-port
      "ctop"
      (lambda (str start count)
        (printf "*** (write! ~s)\n" (substring str start (+ start count)))
        count)
      #f #f #f))
> (textual-port? ctop)
#t
> (binary-port? ctop)
#f
> (write 'blah ctop)
*** (write! "blah")
> (newline ctop)
*** (write! "\n")

Changed in ikarus:
assignee: nobody → aghuloum
importance: Undecided → Medium
status: New → Fix Committed
Revision history for this message
Derick Eddington (derick-eddington) wrote :

I think make-custom-textual-{input|output}-port need to use one of the fast-put- textual tags for the port attributes because:

Ikarus Scheme version 0.0.2patched+ (revision 1242, build 2007-12-14)
Copyright (c) 2006-2007 Abdulaziz Ghuloum

(define ctop
    (make-custom-textual-output-port
      "ctop"
      (lambda (str start count)
        (printf "*** (write! ~s)\n" (substring str start (+ start count)))
        count)
      #f #f #f))
> (textual-port? ctop)
#t
> (binary-port? ctop)
#f
> (write-char #\c ctop)
Unhandled exception
 Condition components:
   1. &error
   2. &who: write-char
   3. &message: "not a textual port"
   4. &irritants: (#<output-port "ctop">)

Changed in ikarus:
status: Fix Committed → New
Revision history for this message
Derick Eddington (derick-eddington) wrote :

Make that: need to use one of the fast-{get|put}- textual tags ...

Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote :

Fixed (again) in revision 1243.

Ikarus Scheme version 0.0.2patched+ (revision 1243, build 2007-12-14)
Copyright (c) 2006-2007 Abdulaziz Ghuloum

> (define ctop
    (make-custom-textual-output-port
      "ctop"
      (lambda (str start count)
        (printf "*** (write! ~s)\n" (substring str start (+ start count)))
        count)
      #f #f #f))
> (write-char #\c ctop)
> (flush-output-port ctop)
*** (write! "c")

Changed in ikarus:
status: New → Fix Committed
Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote :

This bug report is about to be closed as the fix comitted
previously will be incorporated in the next 0.0.3 release of
Ikarus Scheme, scheduled for January 31, 2008. A release
candidate tarball is available for download from:
http://www.cs.indiana.edu/~aghuloum/ikarus/ikarus-0.0.3-rc1.tar.gz
Please do test it if you have the time and report any issues
you might encounter. Thank you very much for your support.
(Sorry for the duplicates; I'm updating every open bug.)

Changed in ikarus:
milestone: none → 0.0.3
Changed in ikarus:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.