diff --git a/src/protocol/eval/executor.rs b/src/protocol/eval/executor.rs index 2e9946bb6cf62cb6001b1472e3a00f8fe9cae134..94cfa43e69728518a3983d7741342a2554ff8f56 100644 --- a/src/protocol/eval/executor.rs +++ b/src/protocol/eval/executor.rs @@ -613,16 +613,6 @@ impl Prompt { let msg_value = cur_frame.expr_values.pop_front().unwrap(); let deref_msg_value = self.store.maybe_read_ref(&msg_value).clone(); - match deref_msg_value { - Value::Message(_) => {}, - _ => { - return Err(EvalError::new_error_at_expr( - self, modules, heap, expr_id, - String::from("Calls to `put` are currently restricted to only send instances of `msg` types. This will change in the future") - )); - } - } - if ctx.did_put(port_id) { // We're fine, deallocate in case the expression value stack // held an owned value @@ -703,6 +693,23 @@ impl Prompt { return Ok(EvalContinuation::Inconsistent) } }, + Method::Print => { + // Convert the runtime-variant of a string + // into an actual string. + let value = cur_frame.expr_values.pop_front().unwrap(); + let value_heap_pos = value.as_string(); + let elements = &self.store.heap_regions[value_heap_pos as usize].values; + + let mut message = String::with_capacity(elements.len()); + for element in elements { + message.push(element.as_char()); + } + + // Drop the heap-allocated value from the + // store + self.store.drop_heap_pos(value_heap_pos); + println!("{}", message); + }, Method::UserComponent => { // This is actually handled by the evaluation // of the statement.