mirror of
https://github.com/kanaka/mal.git
synced 2024-08-17 09:40:21 +03:00
php: allow keyword argument for keyword core function
This commit is contained in:
parent
c937e2a7a9
commit
8efef038f0
@ -65,7 +65,13 @@ function _symbol($name) { return new SymbolClass($name); }
|
||||
function _symbol_Q($obj) { return ($obj instanceof SymbolClass); }
|
||||
|
||||
// Keywords
|
||||
function _keyword($name) { return chr(0x7f).$name; }
|
||||
function _keyword($name) {
|
||||
if (_keyword_Q($name)) {
|
||||
return $name;
|
||||
} else {
|
||||
return chr(0x7f).$name;
|
||||
}
|
||||
}
|
||||
function _keyword_Q($obj) {
|
||||
return is_string($obj) && strpos($obj, chr(0x7f)) === 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user