POV-Ray : Newsgroups : povray.pov4.discussion.general : Request: collapsible code blocks Server Time
22 Dec 2024 05:23:39 EST (-0500)
  Request: collapsible code blocks (Message 1 to 7 of 7)  
From: SharkD
Subject: Request: collapsible code blocks
Date: 10 Jul 2008 03:50:01
Message: <web.4875bee77b0b3828b319b3150@news.povray.org>
I was considering the possibility of adding a collapsible code block feature to
POV, but came to the conclusion that the SDL is too irregular or "loose" for
this to work. Has this been considered before? What was the conclusion that was
come to?

Here's an example of what I mean, from Notepad++:

http://img146.imageshack.us/my.php?image=npplusuy1.jpg

-Mike


Post a reply to this message

From: SharkD
Subject: Re: Request: collapsible code blocks
Date: 10 Jul 2008 04:20:00
Message: <web.4875c535a7b34a59b319b3150@news.povray.org>
"SharkD" <nomail@nomail> wrote:
> I was considering the possibility of adding a collapsible code block feature to
> POV, but came to the conclusion that the SDL is too irregular or "loose" for
> this to work. Has this been considered before? What was the conclusion that was
> come to?
>
> Here's an example of what I mean, from Notepad++:
>
> http://img146.imageshack.us/my.php?image=npplusuy1.jpg
>
> -Mike

Maybe the ability to *manually* set collapse points, similar to setting
bookmarks, would be a suitable arrangement.

-Mike


Post a reply to this message

From: Reactor
Subject: Re: Request: collapsible code blocks
Date: 10 Jul 2008 12:45:01
Message: <web.48763b98a7b34a59840c749b0@news.povray.org>
"SharkD" <nomail@nomail> wrote:
> "SharkD" <nomail@nomail> wrote:
> > I was considering the possibility of adding a collapsible code block feature to
> > POV, but came to the conclusion that the SDL is too irregular or "loose" for
> > this to work. Has this been considered before? What was the conclusion that was
> > come to?
> >
> > Here's an example of what I mean, from Notepad++:
> >
> > http://img146.imageshack.us/my.php?image=npplusuy1.jpg
> >
> > -Mike
>
> Maybe the ability to *manually* set collapse points, similar to setting
> bookmarks, would be a suitable arrangement.
>
> -Mike


Out of curiosity, what do you mean by loose or irregular?  Most blocks of SDL
are surrounded by curly braces, and in theory, one could have a collapse
threshold, where any block surrounded by curly braces that has more lines than
the threshold could be collapsible (allowing nested collapsing, etc).  The user
selecting many lines and selecting a hide or collapse menu option could also
work.  This might be a more platform specific thing, though.




-Reactor


Post a reply to this message

From: SharkD
Subject: Re: Request: collapsible code blocks
Date: 10 Jul 2008 15:45:00
Message: <web.487665b2a7b34a59e116e5c40@news.povray.org>
"Reactor" <rea### [at] hotmailcom> wrote:
> Out of curiosity, what do you mean by loose or irregular?  Most blocks of SDL
> are surrounded by curly braces, and in theory, one could have a collapse
> threshold, where any block surrounded by curly braces that has more lines than
> the threshold could be collapsible (allowing nested collapsing, etc).  The user
> selecting many lines and selecting a hide or collapse menu option could also
> work.  This might be a more platform specific thing, though.
>
>
>
>
> -Reactor

In POV SDL you can overlap or intersect blocks. For instance something like the
following code would be valid:

pigment
{
  #if (true)
    color rgb x
    }
  #else
    color rgb y
    }
  #end


Post a reply to this message

From: Reactor
Subject: Re: Request: collapsible code blocks
Date: 11 Jul 2008 02:15:00
Message: <web.4876f960a7b34a59840c749b0@news.povray.org>
> In POV SDL you can overlap or intersect blocks. For instance something like the
> following code would be valid:
>
> pigment
> {
>   #if (true)
>     color rgb x
>     }
>   #else
>     color rgb y
>     }
>   #end


What about collapsibility for conditional directives?  For instance, the if
could be collapsed and show below the pigment, but if the pigment were
collapsed, it would hide the conditional portion.  Maybe...



-Reactor


Post a reply to this message

From: How Camp
Subject: Re: Request: collapsible code blocks
Date: 11 Jul 2008 09:30:00
Message: <web.48775f8ea7b34a59c59235590@news.povray.org>
"SharkD" <nomail@nomail> wrote:
> In POV SDL you can overlap or intersect blocks. For instance something like the
> following code would be valid:
>
> pigment
> {
>   #if (true)
>     color rgb x
>     }
>   #else
>     color rgb y
>     }
>   #end


Valid, yes... but collapsible code blocks might actually encourage better coding
behavior.  In your example, the preferred alternative is obvious:

pigment
{
  #if (true)
    color rgb x
  #else
    color rgb y
  #end
}

I can't really think of a valid circumstance where the 'looser' form is
necessary (or advantageous)...


Post a reply to this message

From: SharkD
Subject: Re: Request: collapsible code blocks
Date: 11 Jul 2008 21:30:00
Message: <web.487808b8a7b34a5991b9f7880@news.povray.org>
"How Camp" <hac### [at] gmailcom> wrote:
> I can't really think of a valid circumstance where the 'looser' form is
> necessary (or advantageous)...

I have sometimes wished that POV SDL were more regular or strict in its language
conventions. I.e., objects would be defined like objects in other programming
languages (or even as hash arrays, my favorite). But, POV might become more
difficult for new users or suffer in other ways as a result. Source code would
definitely become more voluminous. Consequently, I do not strongly support such
a major overhaul of the SDL, and suggest the manual method of code
collapsability I outlined earlier.

-Mike


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.