I'm currently writing a simple project definition and module definition macro in lang.phn
The idea is to encapsulate modules inside their own namespaces (or perhaps as subnamespaces of the Pharen\Module ns that I'm creating).
The ns function defined in Pharen.php seemed to be the ticket (along with the load macro and use function, however when I define a macro that uses ns it gives the following error at compile time:
PHP Fatal error: Call to undefined method stdClass::compile() in /var/pharen/pharen.php on line 1089
The macro definition that causes this is as follows:
(defmacro defproject (name version)
'(ns ~name)
)
This macro when compiled (linked using load macro) generates this PHP:
<?php
namespace ;
require_once('/var/pharen/lang.php');
use Pharen\Lexical as Lexical;
Lexical::$scopes['api'] = array();
I believe it's that empty namespace that is being generated there that is causing the issue.
Hey there.
I'm currently writing a simple project definition and module definition macro in lang.phn
The idea is to encapsulate modules inside their own namespaces (or perhaps as subnamespaces of the
Pharen\Module
ns that I'm creating).The
ns
function defined in Pharen.php seemed to be the ticket (along with theload
macro anduse
function, however when I define a macro that usesns
it gives the following error at compile time:PHP Fatal error: Call to undefined method stdClass::compile() in /var/pharen/pharen.php on line 1089
The macro definition that causes this is as follows:
This macro when compiled (linked using
load
macro) generates this PHP:I believe it's that empty namespace that is being generated there that is causing the issue.
Any ideas?