October 14, 2008 Re: Template instantiation syntax | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kyle Furlong | Kyle Furlong schrieb:
> Walter Bright wrote:
>> We seem to have reached a dead end on finding a significantly better
>> alternative than foo!(bar).
>>
>> All is not lost, though. Andrei is working on an emacs module that
>> will parse D code and replace foo!(bar) with foo«bar» for display only
>> when the editor is in D mode, the underlying text will still be
>> foo!(bar). (This doesn't affect D at all, only its display in Emacs.)
>>
>> Also, we're going to try using ! for single argument syntax, as in:
>>
>> foo!bar is same as foo!(bar)
>> foo!10 is same as foo!(10)
>>
>> etc. 0 arguments or more than 1 argument or arguments that are more than one token long will still require !( ). We'll see how that works. I think it looks rather nice.
>
> Is it just me or is foo!bar uglier than foo!(bar)? Maybe I'm just used
> to the tried and true syntax.
Seconded.
|
October 14, 2008 Re: Template instantiation syntax | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kyle Furlong | Kyle Furlong wrote:
> Walter Bright wrote:
>> We seem to have reached a dead end on finding a significantly better alternative than foo!(bar).
>>
>> All is not lost, though. Andrei is working on an emacs module that will parse D code and replace foo!(bar) with foo«bar» for display only when the editor is in D mode, the underlying text will still be foo!(bar). (This doesn't affect D at all, only its display in Emacs.)
>>
>> Also, we're going to try using ! for single argument syntax, as in:
>>
>> foo!bar is same as foo!(bar)
>> foo!10 is same as foo!(10)
>>
>> etc. 0 arguments or more than 1 argument or arguments that are more than one token long will still require !( ). We'll see how that works. I think it looks rather nice.
>
> Is it just me or is foo!bar uglier than foo!(bar)? Maybe I'm just used to the tried and true syntax.
Uglier and more ambiguous.
|
October 14, 2008 Re: Template instantiation syntax | ||||
---|---|---|---|---|
| ||||
Posted in reply to Frank Benoit | On Wed, Oct 15, 2008 at 5:48 AM, Frank Benoit <keinfarbton@googlemail.com> wrote:
> Kyle Furlong schrieb:
>> Walter Bright wrote:
>>> We seem to have reached a dead end on finding a significantly better
>>> alternative than foo!(bar).
>>>
>>> All is not lost, though. Andrei is working on an emacs module that
>>> will parse D code and replace foo!(bar) with foo«bar» for display only
>>> when the editor is in D mode, the underlying text will still be
>>> foo!(bar). (This doesn't affect D at all, only its display in Emacs.)
>>>
>>> Also, we're going to try using ! for single argument syntax, as in:
>>>
>>> foo!bar is same as foo!(bar)
>>> foo!10 is same as foo!(10)
>>>
>>> etc. 0 arguments or more than 1 argument or arguments that are more than one token long will still require !( ). We'll see how that works. I think it looks rather nice.
>>
>> Is it just me or is foo!bar uglier than foo!(bar)? Maybe I'm just used
>> to the tried and true syntax.
>
> Seconded.
Thirded, though it does look a bit better with a monospace font. In the proportional font used by gmail, it just shrinks to way to small and hard to see.
--bb
|
October 16, 2008 Re: Template instantiation syntax | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sergey Gromov | Sergey Gromov wrote: > Mon, 13 Oct 2008 01:18:35 +0800, > KennyTM~ wrote: >> Walter Bright wrote: >>> KennyTM~ wrote: >>>> But will be compiler accept T«x» if I directly feed it into the compiler? >>> No. >>> >>>> It's no good if what you see cannot be what you type. >>> The compiler doesn't accept colored text either, but that doesn't impair the usefulness of an editor that displays it that way. >> Because you can't type color, but you can type « and ». > > You can type runes either. Let's use Fehu for function types and literals! Now that's real arcana!! There really should be a programming language that looked magic scrolls! -- Bruno Medeiros - Software Developer, MSc. in CS/E graduate http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D |
October 16, 2008 Re: Template instantiation syntax | ||||
---|---|---|---|---|
| ||||
Posted in reply to Robert Fraser | Robert Fraser wrote: > Andrei Alexandrescu wrote: >> I just told Walter even his code looks good now :o). > > It can replace "goto" with scenes from the Looney Toons? LOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOL Seriously, I gave a good laugh with that one ;D -- Bruno Medeiros - Software Developer, MSc. in CS/E graduate http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D |
October 16, 2008 Re: Template instantiation syntax | ||||
---|---|---|---|---|
| ||||
Posted in reply to Christopher Wright | Christopher Wright wrote: > Dave wrote: >> "Nick Sabalausky" <a@a.a> wrote in message news:gcqvfr$1k6i$1@digitalmars.com... >>> One of the original guiding principles of D is that it be easy to parse. There were a number of valid reasons for this, not just lazyness. >>> >>> Plus, I'm no compiler expert, but I think I rememebr hearing somewhere that overloadng <> to be usable for both comparisons and grouping would require non-context-free grammar. That would be a major increase in D's parsing complexity. C++ grammer is definately not context-free, that's why it can get away with it. Not sure about C# or Java, but I've been under the impression those aren't context-free either. >>> >> >> I can see your point and to a point I think it is a valid concern. >> >> But, most users could care less about that stuff IMO. Abstraction from what a compiler does is why we use higher-level languages in the first place <g> > > C++ is much more popular than D, but I haven't found an IDE for it that has a significant advantage over Descent. Many users care a fair bit about IDEs -- I would, if I didn't work over ssh pretty much of the time. Actually, CDT seems to have advanced quite a lot in its versions 3 and 4 at least in terms of semantic features (code completion, open declaration, open type, and even refactoring). Last time I checked it, it seemed quite better than VC++ 2005 (except perhaps in the area of debugging). -- Bruno Medeiros - Software Developer, MSc. in CS/E graduate http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D |
October 18, 2008 Re: Template instantiation syntax | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | That's looking very nice. Esp. the boolean expressions! - Bent |
October 18, 2008 Re: Template instantiation syntax | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bent Rasmussen | On Sun, Oct 19, 2008 at 7:40 AM, Bent Rasmussen <IncredibleShrinkingSphere@gmail.com> wrote: > That's looking very nice. Esp. the boolean expressions! ERROR: Vote ignored for lack of context. If you're going to go to the trouble to agree to something, you might as well quote what it is that you're agreeing to. :-) --bb |
Copyright © 1999-2021 by the D Language Foundation