<div dir="ltr">The first thing to realize is that "you" cannot do this, but you might be able to write CL-conformant code that does it for you.  But the READ function won't do it by itself.  It's not part of READ's contract, which silently eats Newlines without counting them for you.<div><br></div><div>You might consider some readtable magic, changing Newline to a non-non-breaking macro char that returns nothing but maintains a count somewhere, except such hackery would miss line breaks inside strings, #|comments|#, probably also ;regular comments, and escaped newlines inside symbol names (UGH).</div><div><br></div><div>Rather than writing your own entire READ function, if the source is a regular static file that can be reopened multiple times, wrtie a simple alternative MY-READ function that calls FILE-POSITION before calling READ and returns both a multiple values.  Converting a character FILE-POSITION into a line number, when and if necessary, can be accomplished by reopening the file and reading characters until the desired FILE-POSITION counting line breaks along the way.  Taking care to use the same external-format avoids the difficulty of multi-byte characters and the possibility that FILE-POSITION does not necessarily increment by 1 for each char.  It is only guaranteed to increase monotonically.</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jun 26, 2019 at 9:19 AM Alexandre Rademaker <<a href="mailto:arademaker@gmail.com">arademaker@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div dir="ltr"><font color="#000000"><span style="background-color:rgba(255,255,255,0)"><br></span></font></div><div dir="ltr"><font color="#000000"><span style="background-color:rgba(255,255,255,0)">The “read” function makes really easy to read a bunch of s-expressions from a file, but how can I keep track of the line number where the expressions were in the file?<br><br>Any ideia? </span></font></div><br>Alexandre <br><div id="gmail-m_-856282161114260412AppleMailSignature" dir="ltr">Sent from my iPhone</div></div></blockquote></div>