www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - export keyword

reply "seany" <seany uni-bonn.de> writes:
Hello,

I am considering the follwoing:

I have a wide range of input filess formatted in various ways 
(meteorological data, bathymetry data, geojson, rss warning about 
meteorological events and so on). While I understand that perl is 
the preffered language for processing formatted documents, I 
wrote a D program, which can, up to the completeness of my 
knowledge of formatting schemes, dig through the input files.

Now, the D program digs through all these raw input files, 
converts them to a standard format (similar to JSON, i tailored 
it for my own needs a bit), and then writes them to files, that I 
access with openFoam.

I recon, that D has the keyword "export", with which symbols can 
be accessed accross different applications. But, I dont get much 
info on it.

I could, for example write a D gateway to openFoam - and channel 
the output of the first D program to the later via export.

could anyone give me more information on this?

Thank you
Jun 24 2014
next sibling parent reply "seany" <seany uni-bonn.de> writes:
Also, while we are at it,

does d support declarations like:

class C {

public :

int a;
string b;
double c;

}

etc? If not, could this be implemented in a future version? i.e. 
are there ideas to do so? that would have been nice.

and could I as well write

class C2{

auto x

this(T)(T y)
{
    this.x = y;
}

}

This would help me, for example, to use a single definition, to 
cover, e.g. int and double, and not write them twice - as in 
usual overload...
Jun 24 2014
next sibling parent reply "bearophile" <bearophileHUGS lycos.com> writes:
seany:

 does d support declarations like:

 class C {

 public :

 int a;
 string b;
 double c;

 }
Yes, that's possible.
 and could I as well write

 class C2{

 auto x

 this(T)(T y)
 {
    this.x = y;
 }

 }
This is not possible, and I see no plans in supporting that. You have to use some workaround, like a helper function... Bye, bearophile
Jun 24 2014
parent "seany" <seany uni-bonn.de> writes:
Thnak you, and what about the Export keywords?
Jun 24 2014
prev sibling next sibling parent dennis luehring <dl.soluz gmx.net> writes:
Am 24.06.2014 11:34, schrieb seany:> Also, while we are at it,
 does d support declarations like:

 class C {

 public :

 int a;
 string b;
 double c;

 }
read the manual first http://dlang.org/class
 and could I as well write

 class C2{

 auto x

 this(T)(T y)
 {
      this.x = y;
 }

 }
would not make sense at all you would then also need methods that can auto-magicaly work with your x - that ist not (clean) be possible maybe a template+interface could help - but it seems that your implementation ideas are a little strange - give an example of what you try to reach
Jun 24 2014
prev sibling parent "rumbu" <rumbu rumbu.ro> writes:
On Tuesday, 24 June 2014 at 09:34:44 UTC, seany wrote:

 and could I as well write

 class C2{

 auto x

 this(T)(T y)
 {
    this.x = y;
 }

 }

 This would help me, for example, to use a single definition, to 
 cover, e.g. int and double, and not write them twice - as in 
 usual overload...
class C2(T) { T x; this(T y) { this.x = y } } Eventually C2!T can inherit an abstract class C1 with basic functionality or an interface.
Jun 24 2014
prev sibling parent "Kagamin" <spam here.lot> writes:
On Tuesday, 24 June 2014 at 09:31:08 UTC, seany wrote:
 I recon, that D has the keyword "export", with which symbols 
 can be accessed accross different applications.
It declares symbols from dynamic library.
Jun 24 2014