RE: include paths

new topic     » goto parent     » topic index » view thread      » older message » newer message

On the fly includes is the only way I know of.

This one in particular has bugged me since about 1 week after I tried EU 
for the 1st time.

I've offered multiple solutions that Rob could implement, but I don't 
think he ever responded.

I don't understand why relative path support isn't already implemented. 
It doesn't solve the entire dilemna, but it would certainly help, and 
isn't detrimental to the language or syntax that I can see.

A complete solution requires more consideration, but there are a number 
of possible implementations I can think of.

The best complete solution I can come up with, is to allow variables in 
'include' definitions. Where the definition MUST equate to a string. 
Hardcoded definitons would still be allowed

The only problem I see with this implementation, is the possibility for 
conflicts between hardcoded include definitions, and dynamically defined 
includes.

A solution to the second problem, is to have a different form of include 
syntax. The original syntax would still be valid, but a dynamic 
definition would require enclosing braces.

IE
include c:\\dev_libs\\mylib.e -- original syntax

constant lib_path="c:\\dev_libs\\"
include( lib_path&"mylib.e" ) -- dynamic syntax

include( 12*14/etc+blah ) -- fails, string expected


The complete solution would also incorporate relative paths. It just 
seems odd not to have them. It's the same as the syntax we have now, but 
using relative path notation.

Can anyone see any problems with this implementation?

Has there been any consideration for something like this Rob?



While I'm thinking of improvements for EU...
I remember David Cuny mentioning the inconvenience of comma separators.

EU already ignores commas. Why not allow a leading comma?
A trailing comma wouldn't work, because EU wouldn't be able to determine 
when a list of constants or variables has closed. But a leading comma 
can be ignored without any reprocussion. It's also dead simple to 
incorporate into the language.

IE.
constant
   ,one=1
   ,two=2
   ,three=3
   ,etc=etc

You could then add/remove any item from the list without extra 
modification.

This would apply to constants, variable defines and routine parameters.


Another one that has been mentioned before, but perhaps wasn't heard the 
other times, so I'll say it again...

Assignment on declaration.


All of these suggestions provide no detriment to the existing language. 
They are just conveniences, but for that matter, so is a 'for' loop.

I know EU can do what I want in these circumstances, but why would I 
take a half hour to drive to the grocery store and buy a pack of gum, 
when I can walk to the convenience store in 5 mins?


Rob, I would HIGHLY suggest making a list of the requests that people 
have made, and your responses to them.
I know at least 2 of these 3 things has been directly addressed before.

This would also give people an indication of your intentions, and a 
guide for new suggestions, instead of people repeating the same things 
over again.


If anyone else agrees with this stuff, speak up or forever hold your 
peace. I can make endless suggestions, but Rob is not going to do 
anything solely on my recommendations.

If I'm off base on any of these things, just tell me to shut up :P

Chris


gwalters at sc.rr.com wrote:
> Chris, did you ever get a response on a solution?
> 
> the problem I'm trying to solve is that of having a development lib and 
> a
> production lib. I don't want to mix and dork up production programs with 
> new
> development programs. as well as keep my stuff separate from EU stuff 
> w/o
> having to change hardcoded paths.
> 
> george
> ----- Original Message -----
> From: <bensler at mail.com>
> To: "EUforum" <EUforum at topica.com>
> Sent: Sunday, March 17, 2002 10:56 AM
> Subject: RE: include paths
> 
> 
> > I've mentioned the same thing a few times before, to no avail.
> > There is no way to use any form of equation to define an include.
> >
> > You can have dynamic includes by calling your includes from a secondary
> > include file that was generated on the fly.
> >
> > pseudo-code:
> > open include2.e for writing
> > add the include lines, using the custom path
> > close include2.e
> >
> > include include2.e
> >
> >
> > Chris
> >
> >
> > gwalters at sc.rr.com wrote:
> > > Is there a way to use a variable as an argument of an include statement.
> > > It
> > > seems a little restricteive to have to hard code an absolute path or
> > > accept
> > > the default search relative path of EU.
> > >
> > > I would like to do something like
> > >
> > > Path = getenv("EUDIR") &"/MyInclude/stuff.e"
> > >
> > > include Path
> > >
> > > george
> > >
> > >

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu