Skip to content

Commit

Permalink
Add support for ? and ! in Clojure names.
Browse files Browse the repository at this point in the history
Based on the Java encoded names so _QMARK_ is ? and _BANG_ is !
  • Loading branch information
seancorfield committed Jan 2, 2014
1 parent 5a0136c commit b281130
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cfmljure.cfc
@@ -1,6 +1,6 @@
component {
/*
Copyright (c) 2012, Sean Corfield
Copyright (c) 2012-2014, Sean Corfield
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -86,7 +86,9 @@
public any function _get( string ref ) {
if ( !structKeyExists( variables._refCache, ref ) ) {
if ( find( ".", ref ) ) throw "Qualified name #ref# unsupported in get()";
var fn = replace( ref, "_", "-", "all" );
var fn = replace( replaceNoCase( replaceNoCase( ref, "_qmark_", "?" ),
"_bang_", "!" ),
"_", "-", "all" );
var ns = replace( variables._ns, "_", "-", "all" );
var r = variables._rt.var( ns, fn );
variables._refCache[ref] = new cfmljure( variables._rt, variables._ns )._def( r );
Expand Down

0 comments on commit b281130

Please sign in to comment.