[Gambas-user] C like #include for Gambas

Randall Morgan rmorgan62 at ...626...
Tue Jun 12 16:42:26 CEST 2012


I don't know about Gambas but Python has many libraries for this. Just
google it. If you insist on pre-processing, a simple python script could
get it done quickly. I'm a firm believer in using the tool that makes the
most sense for the project. Of course, that depends on the person and
project....

On Tue, Jun 12, 2012 at 7:30 AM, jm <joem at ...2671...> wrote:

> On Tue, 2012-06-12 at 13:41 +0200, Benoît Minisini wrote:
> > Le 12/06/2012 13:01, jm a écrit :
> > > On Tue, 2012-06-12 at 12:03 +0200, Rolf-Werner Eilert wrote:
> > >>> You already have at your disposal a program which fully understands
> > >>> what to do with #include (and all the other pre-processor directives
> > >>> which have been mentioned). Have you tried it out yet?
> > >>>
> > >>
> > >> Is it possible to insert the C pre-processor into the Play-Button
> > >> function of the Gambas IDE, maybe the way you can insert filters into
> > >> kprinter? That would be ideal here.
> > >>
> > >> Just an idea... :-)
> > >>
> > >> Rolf
> > >
> > > Wow!
> > >
> > > Thinking about it, that is even more powerful to cooperate
> > > with external preprocessor than just adding preprocesor functionality
> on
> > > its own.
> > >
> > > A simple check box in project properties dialog box to enable/disable
> > > preprocessing can turn the feature on/off. Some programs you may just
> > > not want to allow preprocessing and so checking it off here will allow
> > > the compiler to complain bitterly to go get it fixed.
> > >
> >
> > Hi,
> >
> > Sorry if I disappoint you, but I'm strongly against any preprocessing
> > feature in Gambas.
> >
> > I'm talking about code subsitution, not the features currently
> > implemented in the Gambas compiler, that just allow compiling one part
> > of the code or another.
> >
> > Why ?
> >
> > Preprocessing is mainly used (in C) for the three following reasons:
> >
> > 1) Function and variable declaration.
> > 2) Writing the same repeating pattern once.
> > 3) Writing generic functions.
> >
> > In interpreted OO languages, and especially in Gambas, these features
> > are not needed:
> >
> > 1) Function and variable declaration are done automatically by the
> compiler.
> > 2) OO has inheritance.
> > 3) There is no templates (or 'generic') in Gambas as in Java. But you
> > have the Variant datatype.
> >
> > Moreover, preprocessing makes programs mostly unreadable, can create
> > very difficult bugs, make the source code impossible to analyze (bye-bye
> > automatic completion...), and so on.
> >
> > Developing a program is 20% writing it and 80% debugging it. So
> > preprocessing makes that worse.
> >
> > If you need preprocessing in your project, then I think there is a
> > fundamental design flaw in it. I have never need it when writing any big
> > Gambas project.
> >
> > Regards,
>
>
> I take it that is a definite no then? :-)
>
> If I'm really under pressure, then I'm sure I can go
> write a lite preprocessor as needed and manage.
>
> Any chance of exporting IDE's highlighted code as colorful HTML
> for documentation purposes?
>
> Thank you, best regards.
>
>
>
>
> ______________________________________________________________________________
> This message has been checked for viruses and spam by Corpex using
> the ArmourPlate Anti Virus and Anti Spam Scanning Service.
> To find out more and see our email archiving service see
> http://www.armourplate.com or call Corpex on UK 0845 050 1898.
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



-- 
If you ask me if it can be done. The answer is YES, it can always be done.
The correct questions however are... What will it cost, and how long will
it take?



More information about the User mailing list