Arranging code classes and scripts

Discussion of Common Lisp

Arranging code classes and scripts

Postby Pixel_Outlaw » Wed Nov 20, 2013 8:52 pm

I come from an OOP background in C++ so naturally I have some preconceptions of how code is to be organized across multiple files.

How is this usually done in Lisp?
Do I have each Class or struct in a single file?
How many functions in a file before i need to break it in to two?

Most people don't want to work with giant monolithic files when programming.
What are the rules of thumb for splitting a project across multiple files?
Posts: 43
Joined: Mon Aug 26, 2013 9:24 pm

Re: Arranging code classes and scripts

Postby Goheeca » Thu Nov 21, 2013 2:19 am

I do it a module per a file so in a file there are classes, structs which logically belong to each other.
cl-2dsyntax is my attempt to create a Python-like reader. My mirror of CLHS (and the dark themed version). Temporary mirrors of aferomentioned: CLHS and a dark version.
User avatar
Posts: 257
Joined: Thu May 10, 2012 12:54 pm

Re: Arranging code classes and scripts

Postby marcoxa » Thu Nov 21, 2013 1:31 pm

You can do whatever you want as long as it makes sense (TM) YMMV, etc etc.

Having said that, I came to like the one-class one-file organization of Java. Alas, with multimethods and generic functions there isn't a natural breakdown like that in CL.

Marco Antoniotti
Posts: 80
Joined: Thu Aug 14, 2008 6:31 pm

Return to Common Lisp

Who is online

Users browsing this forum: No registered users and 5 guests