WARNING! Access to this system is limited to authorised users only.
Unauthorised users may be subject to prosecution.
Unauthorised access to this system is a criminal offence under Australian law (Federal Crimes Act 1914 Part VIA)
It is a criminal offence to:
(1) Obtain access to data without authority. -Penalty 2 years imprisonment.
(2) Damage, delete, alter or insert data without authority. -Penalty 10 years imprisonment.
User activity is monitored and recorded. Anyone using this system expressly consents to such monitoring and recording.

To protect your data, the CISO officer has suggested users to enable 2FA as soon as possible.
Currently 2.7% of users enabled 2FA.

Commit c233bc9b authored by Tobias Pape's avatar Tobias Pape
Browse files

RPython cannot create closures dynamically

hence, we make _invoke readily availabe. Also, is_empty is now state-based
and not behavior-based
parent c46e9c2c
......@@ -19,9 +19,14 @@ class Primitive(Object, Invokable):
# Set the signature of this primitive
self._set_signature(universe.symbol_for(signature_string))
self.invoke = types.MethodType(invoke, self)
if is_empty:
self.is_empty = is_empty
self._invoke = invoke
#self.invoke = types.MethodType(invoke, self)
self._is_empty = is_empty
def invoke(self, frame, interpreter):
inv = self._invoke
inv(self, frame, interpreter)
def is_primitive(self):
return True
......@@ -49,16 +54,12 @@ class Primitive(Object, Invokable):
def is_empty(self):
# By default a primitive is not empty
return False
return self._is_empty
def empty_primitive(signature_string, universe):
# Return an empty primitive with the given signature
def _invoke(ivkbl, frame, interpreter):
# Write a warning to the screen
universe.std_println("Warning: undefined primitive " +
ivkbl.get_signature().get_string() + " called")
# The empty primitives are empty
def _is_empty(self): return True
return Primitive(signature_string, universe, _invoke, _is_empty)
return Primitive(signature_string, universe, _invoke, True)
def _invoke(ivkbl, frame, interpreter):
# Write a warning to the screen
print "Warning: undefined primitive", ivkbl.get_signature().get_string(), " called"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment