mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 15:21:12 +00:00
List.get with negative index in repl
This commit is contained in:
parent
917e0e2027
commit
b0d57587e3
8 changed files with 109 additions and 33 deletions
|
@ -25,12 +25,13 @@ pub trait ReplApp<'a> {
|
|||
self.call_function(main_fn_name, transform)
|
||||
}
|
||||
|
||||
/// When the executed code calls roc_panic, this function will return None
|
||||
fn call_function_returns_roc_str<T, F>(
|
||||
&mut self,
|
||||
target_info: TargetInfo,
|
||||
main_fn_name: &str,
|
||||
transform: F,
|
||||
) -> T
|
||||
) -> Option<T>
|
||||
where
|
||||
F: Fn(&'a Self::Memory, usize) -> T,
|
||||
Self::Memory: 'a,
|
||||
|
@ -45,12 +46,14 @@ pub trait ReplApp<'a> {
|
|||
|
||||
/// Run user code that returns a struct or union, whose size is provided as an argument
|
||||
/// The `transform` callback takes the app's memory and the address of the returned value
|
||||
///
|
||||
/// When the executed code calls roc_panic, this function will return None
|
||||
fn call_function_dynamic_size<T, F>(
|
||||
&mut self,
|
||||
main_fn_name: &str,
|
||||
ret_bytes: usize,
|
||||
transform: F,
|
||||
) -> T
|
||||
) -> Option<T>
|
||||
where
|
||||
F: FnMut(&'a Self::Memory, usize) -> T,
|
||||
Self::Memory: 'a;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue