Re: [stella] Atari 2600 BASIC compiler

Subject: Re: [stella] Atari 2600 BASIC compiler
From: Adam Thornton <adam@xxxxxxx>
Date: Fri, 8 Jul 2005 10:40:39 -0400
On Jul 8, 2005, at 6:12 AM, Eric Ball wrote:

>> Actually, it wouldn't be a bad idea for the next version of DASM  
>> to error
>> out if a file tries to include itself. I can't think of any useful  
>> use
>> for it; seems like it'd always be an accident...
>>
>
> Although it's probably not common in 2600 ASM, it's not uncommon in  
> C and
> it's relatives.  e.g.  foo.h needs something defined in bar.h,  
> which needs
> something defined in foo.h.  ifdef/define/endif is the usual way of  
> avoiding
> the recursion.

Pretty much all header files really ought to have

#ifndef FOO_H
<real header file foo.h goes here>
#define FOO_H
#endif

This is known as "idempotency" and makes everyone's life a lot easier.

Adam
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://stella.biglist.com

Current Thread