Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Lisp has used directives in comments in the past. Only on the first line of a file but they were parsed.


That had to be very distant past or some non-standard lisp. Common Lisp has no such feature.


That's a feature of the Lisp IDE.

File mode lines described language, the syntax (which Lisp dialect), the Package, the numeric base, the encoding, ...

Example:

    ;;; -*- Mode: lisp; Syntax: ANSI-Common-Lisp; Package: http; Base: 10 -*-
But to implement compiler directives in Common Lisp, this is not needed. That can already be done with macros and reader macros. If you for example use a macro in source code, the compiler will need to expand it. That allows arbitrary code execution during compilation.


It was done on Lisp Machines and currently in CCL.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: