Re: mt questions

shashank <[email protected]>
Newsgroups gmane.lisp.clisp.devel
Message-ID <CAGGv9DiDi-oe1HGW7RWQoRTYFDM1Z6zTZ+y=WTirCanaSGuWSQ@mail.gmail.com>
This is very interesting.

> This is what happens in the sources of clisp, written in .d files, which
> are pre-processed to produce the actual .c intermediary files.

It makes so much sense now, why all the code was written in pre-processed
files. Although I did know
there was supposed to be lot of compile time and template changes made due
to multiple platforms
and additional flags and options.

Thanks! Exchanging emails with all you amazing people provides so much
learning.

---
P.S. -
I hate to disappear. But I spent the past 2-3 days without internet
connection since it broke due to some construction near my house.
Anyway back to normal. Good to be online now.




On Sun, May 4, 2014 at 10:56 PM, Pascal J. Bourguignon <
[email protected]> wrote:

>
>
> On 04 May 2014, at 19:05, shashank <[email protected]> wrote:
>
> > Hey
> >
> > Oh! so that's how its used.
> > Very nicely explained :)
> >
> > Actually I have never seen so many C macros at once and it gets quite
> overwhelming. In the past I have mostly used C for coding algorithms and
> small stuff, for everything else I used python.
> > But this is lovely.
>
> Notice that you can use the C processor on any kind of text, including any
> kind of programming language.
>
> Two examples:
>
> In standard Pascal (as defined in the 70s), a program was made of a single
> file, there were no units or libraries.
> However, you could use #include (and #define, #if, etc if needed), to
> build this single file program using cpp.
>
> Another example, that I have used recently, for a specification document
> where two different objects are specified
> to have similar fields, with only small variants.  The specification for
> the fieds are given in the file rule-actions.txt,
> which contains a few text section in #ifdef / #else / #endif, and a
> Makefile contains rules to generate the two variants:
>
>
> rule-actions-beacon.txt:rule-actions.txt  Makefile
>         @echo "Preprocessing $< for beacons"
>         @cpp -CC -P  -traditional-cpp \
>             -DBEACON \
>             -o rule-actions-beacon.txt rule-actions.txt
>
> rule-actions-geofence.txt:rule-actions.txt  Makefile
>         @echo "Preprocessing $< for geofences"
>         @cpp -CC -P  -traditional-cpp \
>             -UBEACON \
>             -o rule-actions-geofence.txt rule-actions.txt
>
>
> That said, while cpp is almost Turing Complete (if you use it it a loop,
> it becomes Turing Complete), it is still
> quite very rudimentary, and often you will want to write your own specific
> pre-processor.  This is what happens
> in the sources of clisp, written in .d files, which are pre-processed to
> produce the actual .c intermediary files.
>
> This is a very common technique.  A lot of languages began life as C
> pre-processors (Objective-C, C++ (cfront), Pro*C, etc).
>
> —
> __Pascal Bourguignon__
>
>

------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
&#149; 3 signs your SCM is hindering your productivity
&#149; Requirements for releasing software faster
&#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce

_______________________________________________
clisp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/clisp-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.