Ticket #225: port-closed.patch

File port-closed.patch, 1009 bytes (added by sjamaan, 14 years ago)

Implementation of port-closed?

  • chicken.import.scm

    diff --git a/chicken.import.scm b/chicken.import.scm
    index e5d2cba..e26461a 100644
    a b  
    174174   open-input-string
    175175   open-output-string
    176176   parentheses-synonyms
     177   port-closed?
    177178   port-name
    178179   port-position
    179180   port?
  • library.scm

    diff --git a/library.scm b/library.scm
    index 50dffbd..6a504d7 100644
    a b EOF 
    16571657  (and (%port? x)
    16581658       (not (##sys#slot x 1)) ) )
    16591659
     1660(define (port-closed? p)
     1661  (##sys#check-port p 'port-closed?)
     1662  (##sys#slot p 8))
     1663
    16601664;;; Port layout:
    16611665;
    16621666; 0:  FP (special)
  • manual/Unit

    diff --git a/manual/Unit library b/manual/Unit library
    index ef0f01d..ffed0fa 100644
    a b different behavior. 
    207207Write buffered output to the given output-port. {{PORT}} defaults
    208208to the value of {{(current-output-port)}}.
    209209
     210==== port-closed?
     211
     212<procedure>(port-closed? PORT)</procedure>
     213
     214Is the given {{PORT}} closed?
    210215
    211216==== port-name
    212217