Skip to content

Commit

Permalink
fix: 🐛 Functional Bug fix - duplicated prefix of ^^op in cmd
Browse files Browse the repository at this point in the history
Fixed: In the call of cmd `register-operation`, parameter `name_operation` in `Reasoner`'s method `register_operation` was incorrectly encapsulated with an `Operation` resulting in `^^op`
  • Loading branch information
ARCJ137442 committed Oct 23, 2023
1 parent 536dfa8 commit 1b2ec1d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pynars/ConsolePlus.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ def register_operation(*args: List[str]) -> None:
! Unsupported: register mental operations
'''
name = args[0]
"The operator's name without `^` as prefix"
eType = args[1]
code = " ".join(args[2:])
if code == '':
Expand All @@ -316,8 +317,7 @@ def execution_F(arguments: Iterable[Term], task: Task=None, memory: Memory=None)
execution_F.__doc__ = f'''
The execution is auto generated from operator {name} in {eType} mode with code={code}
'''
from pynars.NARS.Operation import Operation
current_NARS_interface.reasoner.register_operation(Operation(name), execution_F)
current_NARS_interface.reasoner.register_operation(name, execution_F)
print(f'Operation {name} was successfully registered in mode "{eType}" with code={code}')


Expand Down

0 comments on commit 1b2ec1d

Please sign in to comment.