Arranging code classes and scripts

Discussion of Common Lisp
Post Reply
Pixel_Outlaw
Posts: 43
Joined: Mon Aug 26, 2013 9:24 pm

Arranging code classes and scripts

Post by 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?

Goheeca
Posts: 271
Joined: Thu May 10, 2012 12:54 pm
Contact:

Re: Arranging code classes and scripts

Post by 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.

marcoxa
Posts: 85
Joined: Thu Aug 14, 2008 6:31 pm

Re: Arranging code classes and scripts

Post by 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.

Cheers
--
MA
Marco Antoniotti

Post Reply