On 10/17/20 8:28 AM, NonNull wrote:
On Friday, 16 October 2020 at 21:28:18 UTC, Steven Schveighoffer wrote:
Inner functions have benefits:
1. They are only accessible inside the function. Which means you only
have to worry about correctness while INSIDE that function.
2. inner functions have
On Friday, 16 October 2020 at 21:28:18 UTC, Steven Schveighoffer
wrote:
Inner functions have benefits:
1. They are only accessible inside the function. Which means
you only have to worry about correctness while INSIDE that
function.
2. inner functions have access to the outer function's stack
On Friday, 16 October 2020 at 19:55:53 UTC, wilcro wrote:
The web page "Programming in D for C Programmers"
(https://dlang.org/articles/ctod.html#forwardfunc) states that
forward declarations are neither required nor permitted, and
that the following construct is allowable:
void myfunc()
{
On 10/16/20 4:47 PM, wilcro wrote:
Thanks to all for your responses; as a related followup question, would
there be any reason to avoid placing the majority of code for a program
outside of the main function?
Inner functions have benefits:
1. They are only accessible inside the function. W
On 10/16/20 1:47 PM, wilcro wrote:
> would
> there be any reason to avoid placing the majority of code for a program
> outside of the main function?
Keeping scopes of symbols as small as possible is a general guideline in
D and elsewhere but I wouldn't crowd my main() function with details of
On Friday, 16 October 2020 at 19:55:53 UTC, wilcro wrote:
The web page "Programming in D for C Programmers"
(https://dlang.org/articles/ctod.html#forwardfunc) states that
forward declarations are neither required nor permitted, and
that the following construct is allowable:
void myfunc()
{
On Fri, Oct 16, 2020 at 08:04:07PM +, Imperatorn via Digitalmars-d-learn
wrote:
[...]
> I think it might be just because you havent defined the function yet
> at that point.
That's not correct; the following works:
module mymodule;
void func() {
forwardfunc()
On Fri, Oct 16, 2020 at 07:55:53PM +, wilcro via Digitalmars-d-learn wrote:
> The web page "Programming in D for C Programmers"
> (https://dlang.org/articles/ctod.html#forwardfunc) states that forward
> declarations are neither required nor permitted,
[...]
> However, the following code will ca
On Friday, 16 October 2020 at 19:55:53 UTC, wilcro wrote:
The web page "Programming in D for C Programmers"
(https://dlang.org/articles/ctod.html#forwardfunc) states that
forward declarations are neither required nor permitted, and
that the following construct is allowable:
void myfunc()
{
On Friday, 16 October 2020 at 19:55:53 UTC, wilcro wrote:
Evidently, I am misunderstanding something very elemental here;
thanks for any enlightenment regarding this.
Inside a function things happen in order, top to bottom,
including declarations (you can only access local variables after
the
The web page "Programming in D for C Programmers"
(https://dlang.org/articles/ctod.html#forwardfunc) states that
forward declarations are neither required nor permitted, and that
the following construct is allowable:
void myfunc()
{
forwardfunc();
}
void forwardfunc()
{
... //do stuff
11 matches
Mail list logo