February 14, 2005
John Reimer wrote:
> Strange.
> 
> I wonder why the non-static version causes the "funclit" error.
> 
> As for the Node struct, perhaps, without the static designation, it can't be accessed properly outside of its module;  the d manual states:

Actually, this was all inside the same module.

> 
> "Static data has only one instance for the entire program, not once per object."
> 
> So what does this imply for non-static module level instances of a struct?  Is access to them limited to the module only?  It would be nice to know a few more nitty gritty details here about how the compiler works.
> 
> -John R.
> 
> 
> 
> John Demme wrote:
> 
>> OK... I fixed the problem by modifying that line from:
>> public Node nodes;
>> to
>> public static Node nodes;
>>
>> John Demme wrote:
>>
>>> Alright.. I've got another clue, although I haven't been able to boil it down to a short test case.
>>>
>>> I've got a struct, called "Nodes" and then, first thing in the module, I've got:
>>> Nodes nodes;
>>> To create a global instance of the struct.
>>>
>>> Any function that uses this struct seems to fail on this error.
>>>
>>> Any suggestions?  Please?
>>>
>>> John
>>>
>>> John Demme wrote:
>>>
>>>> OK... This error message has me totally confused:
>>>> src/com/neuralnexus/nnengine/nodeweb.d(436): function com.neuralnexus.nnengine.nodeweb.nnWebNode.getImmediateChildren cannot access frame of function __funclit9
>>>>
>>>> ????
>>>>
>>>> I'm running DMD 0.113 on Linux.
>>>>
>>>> Thanks
>>>> John
February 15, 2005
To implement the foreach, the compiler internally generates some function literals. Is it possible for you to try whacking out bits of this function to see what the minimum that triggers the error is?


February 15, 2005
Commenting out the foreaches does nothing.  What triggers it is using nodes.  This is also what's triggering my "Weird Linking Error".
With:
public struct Nodes
{
	nnWebNode Root;
	nnWebNode Null;
	nnWebNode String;
	nnWebNode Name;

	nnWebNode[nnNodeID] nodes;
	
	void init()
	{// Stuff
	}
}

And:
public Nodes nodes;
I get the compiler error in any function that does something like:
	public nnWebNode[] getImmediateChildren()
	{
		nnWebNode[] ret;
		if (this == nodes.Null) {}
	}
And it likes that function if I change it to not use nodes.Null.
It'll also compile if I change the:
public Nodes nodes;
line to:
public static Nodes nodes;

However, when I change that line, I get the weird linking issues that I've detailed in that post, as if the static keyword works like it does in C when it's used in the module scope.

Is this two seperate bugs, both out to screw with my head, or two symptoms of the same problem?

John


Walter wrote:
> To implement the foreach, the compiler internally generates some function
> literals. Is it possible for you to try whacking out bits of this function
> to see what the minimum that triggers the error is?
> 
> 
February 15, 2005
Walter,
I've got a test case for it all.  With the first line commented out, it doesn't compile.  With the second line commented out, and the first uncommented, it compiles but doesn't work.  I can't get around this one.
TIA,
John

------------------------------
module test2;

//public static Nodes nodes;
public Nodes nodes;

public struct Nodes {
  Object Null;
  Object Name;

  void init(){}
}

class A {
  public int b() {
    return (this == nodes.Null);
  }
}
--------------------------------------
module test3;

import test2;

void main() {
  nodes.init();
  A a = new A();
  a.b();
}
-------------------------------------

John Demme wrote:
> Commenting out the foreaches does nothing.  What triggers it is using nodes.  This is also what's triggering my "Weird Linking Error".
> With:
> public struct Nodes
> {
>     nnWebNode Root;
>     nnWebNode Null;
>     nnWebNode String;
>     nnWebNode Name;
> 
>     nnWebNode[nnNodeID] nodes;
>         void init()
>     {// Stuff
>     }
> }
> 
> And:
> public Nodes nodes;
> I get the compiler error in any function that does something like:
>     public nnWebNode[] getImmediateChildren()
>     {
>         nnWebNode[] ret;
>         if (this == nodes.Null) {}
>     }
> And it likes that function if I change it to not use nodes.Null.
> It'll also compile if I change the:
> public Nodes nodes;
> line to:
> public static Nodes nodes;
> 
> However, when I change that line, I get the weird linking issues that I've detailed in that post, as if the static keyword works like it does in C when it's used in the module scope.
> 
> Is this two seperate bugs, both out to screw with my head, or two symptoms of the same problem?
> 
> John
> 
> 
> Walter wrote:
> 
>> To implement the foreach, the compiler internally generates some function
>> literals. Is it possible for you to try whacking out bits of this function
>> to see what the minimum that triggers the error is?
>>
>>
1 2
Next ›   Last »