lgrozinger / rdfscript

1 stars 0 forks source link

`this` keyword or similar #24

Closed lgrozinger closed 5 years ago

lgrozinger commented 5 years ago

It would be useful to be able to refer to the name of the expansion within templates and expansions, particularly if this could be passed over to extensions.

As the title says, similar to the this keyword in Java, self in Python etc.

lgrozinger commented 5 years ago

Resolved in commit 58dbe68583d2347d0d775d3800a12f8c26fe7e84. Though the keyword is self, not this.

self used in a template or expansion means the URI of the expansion, or 'instance'.

self in the REPL, or as argument means the 'empty' name. i.e.

The AST objects: Name(None, '', None) and Self(None) evaluate to the same result.