% module: readutil % date: November 22, 2005 % author: Douglas M. Auclair (DMA) % Copyright (c) 2005, Cotillion Group, Inc. All rights reserved. % synopsis: gives the ability to read a file in as a string, % a la SWI readutil module. :- module(readutil, [read_file_to_codes/3]). read_file_to_codes(Filename, String, _Params) :- see(Filename), do_read(String, ""), seen. do_read --> { get0(Char) }, ({ Char = -1 } -> []; [Char], do_read).