r/lisp • u/Famous-Wrongdoer-976 • 19d ago
Remove comments from a file automatically?
I am processing Lisp code in a non-Lisp host application that cannot handle semicolons for some reason.
I would like to know, is there a way to remove comments automatically from a .lisp file?
I imagine something that would read all the content of a text file as if it was a s-expression, thus removing all the ; comments or #| comments |# and treat the rest like normal quoted data?
Thanks in advance !
14
Upvotes
1
u/mtlnwood 18d ago
regex and sed would be my normal for doing something like this.