[Ur] C type for Ur/Web list type
Artyom Shalkhakov
artyom.shalkhakov at gmail.com
Thu Apr 14 06:53:56 EDT 2016
Hello all,
I'd like to implement a function having the following type:
> val join : list string -> option string -> string
which would work as follows:
- if second argument is Some, then it's taken as a separator
- otherwise, it's assumed that no separator is necessary
- the list of strings is concatenated into one contiguous string, with
the separator inserted between the consecutive list elements
For instance:
> join [] _(*anything*) ==> ""
> join ["a","b"] None ==> "ab"
> join ["1","2"] (Some ",") ==> "1,2"
I'd like to use C for implementation, and there is this question: what
C types do [list string] and [option string] map to? I think that
[option string] probably maps to a nullable pointer to
uw_Basis_string. What about the list constructor?
--
Cheers,
Artyom Shalkhakov
More information about the Ur
mailing list