metacall always hashes in user (re: issue #27)
This commit is contained in:
@@ -28,7 +28,8 @@ impl<'a> CodeDirs<'a> {
|
|||||||
{
|
{
|
||||||
match in_mod.as_str() {
|
match in_mod.as_str() {
|
||||||
"user" | "builtin" => self.code_dir.get(&(name, arity)).cloned(),
|
"user" | "builtin" => self.code_dir.get(&(name, arity)).cloned(),
|
||||||
_ => match self.modules.get(&in_mod) {
|
_ =>
|
||||||
|
match self.modules.get(&in_mod) {
|
||||||
Some(&Module { ref code_dir, .. }) =>
|
Some(&Module { ref code_dir, .. }) =>
|
||||||
code_dir.get(&(name, arity)).cloned().map(CodeIndex::from),
|
code_dir.get(&(name, arity)).cloned().map(CodeIndex::from),
|
||||||
None => None
|
None => None
|
||||||
@@ -426,8 +427,7 @@ pub(crate) trait CallPolicy: Any {
|
|||||||
},
|
},
|
||||||
&ClauseType::CallN =>
|
&ClauseType::CallN =>
|
||||||
if let Some((name, arity)) = machine_st.setup_call_n(arity) {
|
if let Some((name, arity)) = machine_st.setup_call_n(arity) {
|
||||||
if let Some(idx) = code_dirs.get(name.clone(), arity, machine_st.p.module_name())
|
if let Some(idx) = code_dirs.get(name.clone(), arity, clause_name!("user")) {
|
||||||
{
|
|
||||||
self.context_call(machine_st, name, arity, idx, lco)
|
self.context_call(machine_st, name, arity, idx, lco)
|
||||||
} else {
|
} else {
|
||||||
Err(predicate_existence_error(name, arity, machine_st.heap.h))
|
Err(predicate_existence_error(name, arity, machine_st.heap.h))
|
||||||
|
|||||||
Reference in New Issue
Block a user