Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
12 views1 page

Lisp Lab Manual Part5

This document is a lab manual section on file handling and system interaction in Common Lisp. It covers topics such as opening and writing files using WITH-OPEN-FILE, reading from files, and interacting with the operating system. Examples are provided to demonstrate file writing and reading operations.

Uploaded by

padmahyd2405
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views1 page

Lisp Lab Manual Part5

This document is a lab manual section on file handling and system interaction in Common Lisp. It covers topics such as opening and writing files using WITH-OPEN-FILE, reading from files, and interacting with the operating system. Examples are provided to demonstrate file writing and reading operations.

Uploaded by

padmahyd2405
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Common Lisp Lab Manual

Part 5: File Handling and System Interaction


Author: Padma

Reading/Writing Files in Lisp

Topics:

- Opening and writing files with WITH-OPEN-FILE

- Reading from files

- Interacting with the OS

Example:

(with-open-file (stream "output.txt" :direction :output :if-exists :supersede)

(format stream "Hello from Lisp!"))

(with-open-file (stream "output.txt")

(loop for line = (read-line stream nil)

while line do (print line)))

You might also like