In which order should code in a single lisp file be organised?  Is there any common style guideline that allows other lisp programmers to easily understand code?Googling for lisp style guideline yields plenty results; among them:Common Lisp Style Guide by GoogleCommunity-driven Emacs Lisp style Guide by Bozhidar Batsov, contains details about formatting, indentation, sapces versus tabs.Tutorial on Good Lisp Programming Style by Peter Norvig and Kent Pitman, details the reasoning behind adhering to a style and the rationale for making certain choices.However, non appear to discuss how functions and other definitions should be organised within a single source file.Clean Code by Martin Fowler (which is not specifically targeted at Lisp) recommends organising functions/methods top to bottom: first describing the code abstractly and next delving deeper and deeper into details.  Which is in my opinion a good way to organise function definitions.However, when the function definitions are ordered top to bottom, the SBCL REPL gives caught STYLE-WARNING: undefined function:  when loading a lisp file.  So apparently SBCL thinks using a function before defining it is bad style.What is the best practice for the order of definitions?  Preferably without resulting in compiler/interpreter warnings.
In which order should lisp functions be defined?
lisp;common lisp
For Common Lisp I'm using something like this:files are organized in systems and subsystems (see for example ASDF as a tool for that)you can put everything in one file, but that takes some carelarger pieces of Lisp are organized in systems of files (see above) and are usually compiled with the file compilerusing compile-file, a file is a compilation unitFiles in a system:system declaration(s)package declaration(s)utility functionsmacrosclassesvarious codemachine/os/implementation specific codea system for testsa subsystem in a file:editor header (mode, package, dialect, text encoding, base, ...)copyright, licensepurpose and usage descriptionusing which packageglobal configuration vars / dataconstantsmain classescondition classesmacros and their support codegeneric functions / methods / functionsexamplesIf you develop, you load the compiled system developed so far and extend it incrementally. Once a new functionality is written and tested -> compile the system again, load it and test it again.The old book 'Lisp: Style and Design' by Molly M. Miller and Eric Benson describes organizing principles and gives an example. Since this book is old, there is some newer infrastructure and some new tools. But the general principles mentioned in the book are still useful.