D2 & Web-Framework

Adam D. Ruppe destructionator at gmail.com
Wed Jul 3 06:05:26 PDT 2013


On Wednesday, 3 July 2013 at 09:24:03 UTC, RedX wrote:
> is this still working on the latest git (2bfdccc)? I don't seem 
> to be able to call anything..

I found the bug, I had a static if that was too restrictive and 
stopped reading the child object functions.

It is fixed now on the newest github version.


The regular functions and child ApiProviders are still working, 
though the child ApiObject thing is mildly buggy, the initialize 
and initializePerCall aren't always done right, so if you 
override them, you need to call the parent too. Or something like 
that, I have it working in a program but it was a bug workaround 
hack.

Regular functions work excellently though!

> And do public functions really require "export" now or am i 
> just declaring them in i wrong way?

Yes, they need export now. You can easily work around it by 
writing

class MySite : ApiProvider {
   export:
     string hello() {}
// etc
}

The export: at the top will apply to everything unless you 
override it on a specific function.


The reason it does this is to get more control over if you want 
helper functions to show up publicly or not. Before it used a 
leading _ in the name to skip, which still works, but now you can 
also use other access specifiers.

It uses export instead of public because public is available to 
other modules, export I took to mean even more available to 
outside the program.


More information about the Digitalmars-d mailing list