Changeset 35113 in project


Ignore:
Timestamp:
02/10/18 16:16:04 (8 days ago)
Author:
sjamaan
Message:

man/5: Move port procedure documentation. Unit library is now empty!

Location:
wiki/man/5
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • wiki/man/5/Module (chicken base)

    r35112 r35113  
    13451345
    13461346
     1347=== Ports
     1348
     1349==== String ports
     1350
     1351===== get-output-string
     1352
     1353<procedure>(get-output-string PORT)</procedure>
     1354
     1355Returns accumulated output of a port created with
     1356{{(open-output-string)}}.
     1357
     1358
     1359===== open-input-string
     1360
     1361<procedure>(open-input-string STRING)</procedure>
     1362
     1363Returns a port for reading from {{STRING}}.
     1364
     1365
     1366===== open-output-string
     1367
     1368<procedure>(open-output-string)</procedure>
     1369
     1370Returns a port for accumulating output in a string.
     1371
     1372
     1373=== File Input/Output
     1374
     1375==== flush-output
     1376
     1377<procedure>(flush-output [PORT])</procedure>
     1378
     1379Write buffered output to the given output-port. {{PORT}} defaults
     1380to the value of {{(current-output-port)}}.
     1381
     1382=== Port predicates
     1383
     1384==== input-port-open?
     1385
     1386<procedure>(input-port-open? PORT)</procedure>
     1387
     1388Is the given {{PORT}} open for input?
     1389
     1390<procedure>(output-port-open? PORT)</procedure>
     1391
     1392Is the given {{PORT}} open for output?
     1393
     1394==== port-closed?
     1395
     1396<procedure>(port-closed? PORT)</procedure>
     1397
     1398Is the given {{PORT}} closed (in all directions)?
     1399
     1400==== port?
     1401
     1402<procedure>(port? X)</procedure>
     1403
     1404Returns {{#t}} if {{X}} is a port object or {{#f}}
     1405otherwise.
     1406
    13471407---
    13481408Previous: [[Module srfi-4]]
  • wiki/man/5/Module (chicken port)

    r34261 r35113  
    66This module contains various extended port definitions.
    77
    8 TODO:
    9 
    10 * Add {{port-closed?}}
    11 * Add {{port-name}}
    12 * Add {{port-position}}
    13 * Add {{port?}}
    14 * Add {{flush-output}}
    15 * Add {{get-output-string}}
    16 * Add {{open-input-string}}
    17 * Add {{open-output-string}}
    18 * Add {{set-port-name!}}
    19 * Add {{terminal-port?}}
    20 * Add {{terminal-name}}
    21 * Add {{terminal-size}}
    22 * What to do with {{make-bidirectional-port}}?
     8=== Port attributes
     9
     10==== port-name
     11
     12<procedure>(port-name [PORT])</procedure>
     13
     14Fetch filename from {{PORT}}. This returns the filename that was used to open
     15this file. Returns a special tag string, enclosed into parentheses for
     16non-file ports. {{PORT}} defaults to the value of {{(current-input-port)}}.
     17
     18
     19==== port-position
     20
     21<procedure>(port-position [PORT])</procedure>
     22
     23Returns the current position of {{PORT}} as two values: row and column number.
     24If the port does not support such an operation an error is signaled. This
     25procedure is currently only available for input ports. {{PORT}} defaults to the
     26value of {{(current-input-port)}}.
     27
     28
     29==== set-port-name!
     30
     31<procedure>(set-port-name! PORT STRING)</procedure>
     32
     33Sets the name of {{PORT}} to {{STRING}}.
     34
    2335
    2436=== Setting the file buffering mode
Note: See TracChangeset for help on using the changeset viewer.