wolfgangj / bone-lisp

The Bone Lisp programming language
Other
321 stars 21 forks source link

Use of "my" prefix #4

Closed g0xA52A2A closed 8 years ago

g0xA52A2A commented 8 years ago

Sorry for the naive question but can you please explain the "my" prefixes used in the code? I'm not sure what their purpose is, things seem of compile ok without them.

wolfgangj commented 8 years ago

It is defined in bone.h as:

#define my static

So yes, things will compile without it (for now) since there are no name conflicts.

Why did I introduce it? I've written lots of C code, but "static" as a keyword for declaring that something is local to the compilation unit never became second nature for me; of course I know what it means, but I can always feel a slight mental burden imposed by it. So it seemed reasonable to replace it with something that does not get in the way of my thought processes. (Nowadays, people often replace lambda in Lisps with fn, probably for very similar reasons.)

It's also consistent with the use of "my" in Bone Lisp itself (e.g. mysub for local subroutines) and used as a keyword in various other programming languages (like Perl).

g0xA52A2A commented 8 years ago

Aha I'd missed thank, thanks!

wolfgangj commented 8 years ago

You're always welcome to ask questions. :)