Terminal control/Positional read: Difference between revisions

(→‎{{header|TXR}}: Reduce oversized char array.)
(→‎{{header|TXR}}: Add notes.)
Line 235:
(error "ReadConsoleOutputCharacter read zero characters"))
(format t "character is ~s\n" [chars 0])))</lang>
 
Notes:
* An <code>ptr-out</code> to an <code>array</code> of 1 <code>DWORD</code> is used for the number of characters out parameter. The FFI type <code>(ptr-out DWORD)</code> cannot work as a function argument, because integer objects are not mutable, and there isn't any concept of taking the address of a variable. A vector of 1 integer is mutable, and by making such a vector correspond with the FFI type <code>(array 1 DWORD)</code>, the necessary semantics is achieved.
* The quasiquote expression <code>^#S(COORD X ,(+ 2 cinfo.srWindow.Left) Y ,(+ 5 cinfo.srWindow.Top))</code> is equivalent to <code>(new COORD X (+ 2 cinfo.srWindow.Left) Y (+ 5 cinfo.srWindow.Top))</code>. It is done this way to demonstrate support for structure quasiquoting.
 
=={{header|XPL0}}==
543

edits