June 13, 2008
Along those lines, here's one I use all the time:

  import std.stdio;

  int main(string[] args)
  {
    return 0;
  }
June 13, 2008
John A. De Goes schrieb:
> Hi,
> 
> We're adding support for the D language to UNA (http://www.n-brain.net). The Personal Edition has been released free of charge (down from $100).

> Assuming this is correct, we'd like to proceed with adding commonly used source code constructs, D idioms, and so forth. We call this 'source snippets'. Each source snippet has a few letter textual key. Typing that key and invoking the source snippet button inserts the snippet.

A lot of DWT (SWT) JFace snippets are in my mind, but it depends on how flexible your snippet editor is.
For instance :
JFSF =
class SimpleForm : ApplicationWindow {
.........
}
should become :
class {1} : ApplicationWindow {
.........
}
so typing JFSF should open a popup asking for the the classname.

In case that your IDE is that flexible, a couple a DWT, JFace snippets,  are possible... Otherwise take it as enhancement suggestion :)
Bjoern




June 13, 2008
Chris R. Miller schrieb:

> Well there's your problem!  Come back later when you're educated.

Why are you so unfriendly?


June 13, 2008
Here are the snippets used by Descent:

http://dsource.org/projects/descent/browser/trunk/descent.ui/templates/default-templates.xml

There should probably be more, because we didn't spend much time with that file.

John A. De Goes a écrit :
> Thanks for the friendly reply. Looks like I caught people on a bad day. :-)
> 
> I have identified all the basic constructs, but wonder if I may be missing some things. For example, in Java, the following idioms are quite common (the first two, in concurrent programming):
> 
> synchronized (object) {
>     object.notifyAll();
> }
> 
> synchronized (object) {
>     while (!condition) {
>         try {
>             object.wait();
>         }
>         catch (InterruptedException e) {
>             break;
>         }
>     }
> }
> 
> new Runnable() {
>     public void run() {
>     }
> }
> 
> public static void main(String[] args) {
> }
> 
> These among many others. But I lack the familiarity with D to make such judgements. I was hoping regular D programmers had some oft-used favorites they could throw in.
> 
> Regards,
> 
> John
> 
> 
> Georg Wrede Wrote:
> 
>> John A. De Goes wrote:
>>> Hi,
>>>
>>> We're adding support for the D language to UNA
>>> (http://www.n-brain.net). The Personal Edition has been released free
>>> of charge (down from $100).
>>>
>>> However, none of us have used D so we'd like a bit of help.
>>>
>>> We've added support (in dev version) to matching messages of the
>>> form:
>>>
>>> foo.d(5): Warning: silly variable name foo.d(5): Error: spelling
>>> error in variable name "foobir"
>>>
>>> Assuming this is correct, we'd like to proceed with adding commonly
>>> used source code constructs, D idioms, and so forth. We call this
>>> 'source snippets'. Each source snippet has a few letter textual key.
>>> Typing that key and invoking the source snippet button inserts the
>>> snippet.
>>>
>>> So I'm soliciting for everyone's favorite source snippet.
>> Either there's something about your company that those who've already posted in this thread know and don't like, or the guys simply were in a bad mood.
>>
>> Personally I'm glad that D support is being added by a new vendor, that is always welcome.
>>
>> ---
>>
>> You've already probably downloaded the DMD compiler to get the documentation and lists of reserved words, etc. Witht that same download comes a wealth of source code, from which it should be possible to collect the most used idioms.
>>
>> They aren't all that different from what the typical Java or C idioms are, so it might be enough to just have most basic construct snippets.
> 
June 13, 2008
"Robert Fraser" <fraserofthenight@gmail.com> wrote in message news:g2sp22$1dnc$1@digitalmars.com...
> John A. De Goes wrote:
>> We've added support (in dev version) to matching messages of the form:
>>
>> foo.d(5): Warning: silly variable name
>> foo.d(5): Error: spelling error in variable name "foobir"
>
> There's multi-line error messages (for example, if there's an ambiguous overload), and occasionally messages don't have a line, just a file.

And occasionally they have the right line but wrong file, and sometimes, _sometimes_ they have nothing at all.

But those aren't intended ;)


June 13, 2008
Hi Bjoern,

Yes, this is possible. You just use a macro in the source snippet, e.g. ${CLASS}, and then when you insert it, it places the caret at the first macro: filling it in replaces all instances of the macro, and hitting Enter takes you to the next one. No pop up dialogs, but it accomplishes the same thing (with less invasiveness and annoyance).

Where do DWT and JFace fit into the grand scheme of things? That is, are they as ubiquitous in D as Swing and SWT are in the Java community?

Regards,

John

BLS Wrote:
> A lot of DWT (SWT) JFace snippets are in my mind, but it depends on how
> flexible your snippet editor is.
> For instance :
> JFSF =
> class SimpleForm : ApplicationWindow {
> .........
> }
> should become :
> class {1} : ApplicationWindow {
> .........
> }
> so typing JFSF should open a popup asking for the the classname.
> 
> In case that your IDE is that flexible, a couple a DWT, JFace snippets,
>   are possible... Otherwise take it as enhancement suggestion :)
> Bjoern

June 13, 2008
Robert Fraser Wrote:
> There's multi-line error messages (for example, if there's an ambiguous overload), and occasionally messages don't have a line, just a file.

Crap.

Now it's easy enough to support a new style of error reporting, if the format is consistent, but not so easy when it's hard to break things down into a small number of patterns. Multiline errors are particularly difficult because it's often not apparent when they end, or what is the most important part of the message.

Without documentation on the format, the best I can do is to experiment with the compiler and try to elicit all possible errors/warnings. And hope they fall into a small number of consistent patterns (which seems likely given that all the errors I encountered so far matched the above patterns).

Anyone having inside knowledge of the format care to save me some time here? (Walter, you listening? :-)

Regards,

John
June 13, 2008
Hi Ary,

Nice! Thank you so much. I'd be happy to send you our template file when it's finished.

Regards,

John

Ary Borenszweig Wrote:

> Here are the snippets used by Descent:
> 
> http://dsource.org/projects/descent/browser/trunk/descent.ui/templates/default-templates.xml
> 
> There should probably be more, because we didn't spend much time with that file.
> 

June 13, 2008
Looks good to me. Thanks.

Regards,

John

Walter Bright Wrote:

> Along those lines, here's one I use all the time:
> 
>    import std.stdio;
> 
>    int main(string[] args)
>    {
>      return 0;
>    }

June 13, 2008
John A. De Goes schrieb:
> Hi Bjoern,
> 
> Yes, this is possible. You just use a macro in the source snippet, e.g. ${CLASS}, and then when you insert it, it places the caret at the first macro: filling it in replaces all instances of the macro, and hitting Enter takes you to the next one. No pop up dialogs, but it accomplishes the same thing (with less invasiveness and annoyance).
> 
That is pretty cool!

> Where do DWT and JFace fit into the grand scheme of things? That is, are they as ubiquitous in D as Swing and SWT are in the Java community?
> 
DWT is "per se" the standard GUI library for D. Means: Walter (the D language creator) declared SWT/DWT as standard GUI. DWT is ATM en pair with SWT 3.4M7, in other words bleeding edge.
So yes, DWT/JFace/Forms is for D what SWT etc. means for Eclipse/Java.

(It was allmost Frank Benoit, who made that hercules work) further information at : http://www.dsource.org/projects/dwt

You'll also find links to DWT/JFace/Forms snippets on this page which are most probabely usefull as snippet templates..

OFF TOPIC
Since about 3 years I am working on a realtime developer collaboration IDE. (slightly different in that I am using a C/S RDBMS as SCM) Would be interesting to exchange some ideas ...

Regards, Bjoern