On Monday, 13 March 2017 at 17:29:41 UTC, Inquie wrote:
Does D have any nice way to specify a block for cold folding? I
have a very large set of structs and I'd like to be able to
code fold them all at once and together.
I have been using
static if(true)
{
... junk
}
but the static if is
On Saturday, 18 March 2017 at 05:00:48 UTC, Entity325` wrote:
and both create a scope outside of which no declarations inside
them are visible(potentially undesirable side-effects).
Oh. Static ifs don't do that. Disregard, I'm wrong.
FYI,
static if(true)//comments are great for adding some context to
your code.
{
//stuff
}
and
{//let's toss a comment on the scope declaration!
//stuff
}
are functionally equivalent in my IDE. Both will fold down to
only the top {(good), and both create a scope outside of which no
dec
On 03/14/2017 02:48 PM, Inquie wrote:
>> version (all) {
>> // ...
>> }
>>
>> You can define your own version identifiers as well:
>>
>> version = some_descriptive_name;
>>
>> version (some_descriptive_name) {
>> // ...
>> }
>>
>> Ali
>
> Oh, that might be better. I thought of versions bu
On Tuesday, 14 March 2017 at 20:56:02 UTC, Ali Çehreli wrote:
On 03/13/2017 10:29 AM, Inquie wrote:
Does D have any nice way to specify a block for cold folding?
I have a
very large set of structs and I'd like to be able to code fold
them all
at once and together.
I have been using
static if
On 03/13/2017 10:29 AM, Inquie wrote:
Does D have any nice way to specify a block for cold folding? I have a
very large set of structs and I'd like to be able to code fold them all
at once and together.
I have been using
static if(true)
{
... junk
}
but the static if is uninformative since
On Tuesday, 14 March 2017 at 17:07:57 UTC, Adam D. Ruppe wrote:
On Monday, 13 March 2017 at 17:29:41 UTC, Inquie wrote:
Does D have any nice way to specify a block for cold folding?
I personally sometimes use
// some description {
// }
since my editor does a really good job matching {}, eve
On Tuesday, 14 March 2017 at 16:58:21 UTC, Inquie wrote:
On Tuesday, 14 March 2017 at 16:29:15 UTC, Mike Parker wrote:
[...]
It's not that I feel strongly about, I simply would like the
best useable solution. Like usually what happens, my original
post was taken completely out of context:
On Monday, 13 March 2017 at 17:29:41 UTC, Inquie wrote:
Does D have any nice way to specify a block for cold folding?
I personally sometimes use
// some description {
// }
since my editor does a really good job matching {}, even in
comments so it is convenient to jump anywhere, and i can se
On Tuesday, 14 March 2017 at 16:29:15 UTC, Mike Parker wrote:
On Tuesday, 14 March 2017 at 15:44:27 UTC, Inquie wrote:
So, with all the bloviating, all I have arrived at is that my
original hack is still the only way to get the cold folding I
wanted(the original use case I had in mind, even
On Tuesday, 14 March 2017 at 16:29:15 UTC, Mike Parker wrote:
If it's something you feel strongly about, then the way to go
about it is to put together a DIP. There was a time when you
could open a forum post about a new feature and eventually see
it added, but those days are long gone (for go
On Tuesday, 14 March 2017 at 15:44:27 UTC, Inquie wrote:
So, with all the bloviating, all I have arrived at is that my
original hack is still the only way to get the cold folding I
wanted(the original use case I had in mind, even though I'd
rather have proper code structuring support in gene
with D in the first place. I do not use Emacs but
the Visual D, which I assume is the sponsored IDE for D.
This is an issue for the IDE, not for the language, and
changing the language would not have any effect on IDE support
for code folding.
Remember, it is not just about code folding(whic
s:
https://www.emacswiki.org/emacs/FoldingMode
This is an issue for the IDE, not for the language, and changing
the language would not have any effect on IDE support for code
folding.
Just for fun:
1. Folding directives are glorified comments. #region has zero
meaning to the compiler; it's a hint to the editor to allow code
folding. It doesn't do any namespacing or scoping. Why, exactly,
are we writing code to accommodate the editor? It boggles my mind
tha
file can be visibly reduced.
If you have enough declarations in one file that they call for
code folding, it may be better to move them to a separate
module. Public imports and aliases allow doing this without
breaking any code.
Maybe, maybe not... proves nothing as it is just your preference
On Tuesday, 14 March 2017 at 00:38:12 UTC, Vladimir Panteleev
wrote:
If you have enough declarations in one file that they call for
code folding, it may be better to move them to a separate
module. Public imports and aliases allow doing this without
breaking any code.
[...]
Generally
ypes in a single file, it is nice
to be able to fold them. It is also nice to be able to group
them in some way(hence the question) and fold the group so that
large chunks of the file can be visibly reduced.
If you have enough declarations in one file that they call for
code folding, it may be
... junk
> >>
> >> }
> >>
> >> but the static if is uninformative since that is the only line
> >> that is shown when folded. A comment helps but still kinda
> >> ugly.
> >>
> >> C# has #regions and hopefully D has something a
not a
comment).
From my understanding of the feature, it does the same as
// region
... code to be folded ...
// endregion
An IDE can then read those comments and allow code folding. It
might meet some definition of a language feature, but it is
nothing more than a comment.
I use visual studio a
On Monday, 13 March 2017 at 21:17:31 UTC, XavierAP wrote:
On Monday, 13 March 2017 at 17:29:41 UTC, Inquie wrote:
I have been using
static if(true)
{
... junk
}
Indeed #region is part of the C# specification, even if it has
no effect on the code. (The specification does not say anything
On Monday, 13 March 2017 at 17:29:41 UTC, Inquie wrote:
I have been using
static if(true)
{
... junk
}
Indeed #region is part of the C# specification, even if it has no
effect on the code. (The specification does not say anything
about folding/collapsing, just about "marking sections of
e and together.
I have been using
static if(true)
{
... junk
}
but the static if is uninformative since that is the only line
that is shown when folded. A comment helps but still kinda
ugly.
C# has #regions and hopefully D has something as useful.
Code-folding is an IDE thing,
g
>
> static if(true)
> {
> ... junk
> }
>
> but the static if is uninformative since that is the only line
> that is shown when folded. A comment helps but still kinda ugly.
>
> C# has #regions and hopefully D has something as useful.
Code-folding is an IDE thing, not a l
Does D have any nice way to specify a block for cold folding? I
have a very large set of structs and I'd like to be able to code
fold them all at once and together.
I have been using
static if(true)
{
... junk
}
but the static if is uninformative since that is the only line
that is shown
25 matches
Mail list logo