Forums

"use" will now locate libraries

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

"use" will now locate libraries

Postby Charles » Tue Oct 07, 2008 1:59 am

In development, I have enhanced:
use Foo.Bar
to locate Foo.Bar.dll if the compiler cannot immediately locate the namespace. This means that instead of:

cobra -reference:Foo.Bar MyProg.cobra

you can just say:

cobra MyProg.cobra

Furthermore, if the filename of the library differs, you can specify it with:
use Foo.Bar from SomeLib
You can put single or double quotes around the file name if its components are not legal identifiers (for example, the filename has a space or punctuation mark in it).

No ".dll" extension is expected (or allowed) in any of this syntax.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: "use" will now locate libraries

Postby hopscc » Thu Oct 09, 2008 5:02 am

And very nice it is too

Probably should also correct leading comments in applicable files in HowTo (Samples?)
380-WinForms.cobra at least ( or provide variant that doesnt have metainfo for -testifies invocation - additional test)

Another thought...
When you add a feature- additional new syntax could you put a updated syntax description /diagram in the discussion writeup?
That way its relatively easy for someone else to take that and create/update the wiki doc for that feature rather than having to determine
the new syntax from either gleaning through any examples, scanning across all the discussion forum articles or reverse spelunking through the changed code...
If the doc is easier to augment we may well probably get more of it (hopefully)...
hopscc
 
Posts: 632
Location: New Plymouth, Taranaki, New Zealand

Re: "use" will now locate libraries

Postby Charles » Thu Oct 09, 2008 9:39 pm

Acknowledged.

And in case you still need it:
use <namespace> [from <library-name>]

<library-name> can be a simple identifier, qualified identifier (Foo.Bar) or a string literal.

Regarding terminology, I'm steering towards "library" rather than .NET's "assembly" or "dll", or Java's "class file" or "jar file".
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: "use" will now locate libraries

Postby hopscc » Sun Oct 12, 2008 1:02 am

Perfect
hopscc
 
Posts: 632
Location: New Plymouth, Taranaki, New Zealand


Return to Discussion

Who is online

Users browsing this forum: No registered users and 102 guests

cron