Make String.aes a stdlib + add more string functions
This means moving the FATE operations to StringInternal and adding to/from_list (and Char.to/from_int + Char.to_upper/lower).
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
|
||||
include "String.aes"
|
||||
contract BytesToX =
|
||||
|
||||
entrypoint to_int(b : bytes(42)) : int = Bytes.to_int(b)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
|
||||
include "String.aes"
|
||||
contract FunctionArguments =
|
||||
|
||||
entrypoint sum(n : int, m: int) =
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
include "String.aes"
|
||||
contract StringX =
|
||||
entrypoint test() =
|
||||
let s1 = "a string"
|
||||
let s2 = "another string"
|
||||
let s = String.concat(s1, s2)
|
||||
String.sha256(s)
|
||||
String.length(s1)
|
||||
String.from_list(String.to_list(s))
|
||||
String.split(4, s1)
|
||||
String.at(2, s2)
|
||||
String.tokens(s, ",")
|
||||
String.to_upper(s1)
|
||||
String.to_lower(s2)
|
||||
@@ -1,3 +1,4 @@
|
||||
include "String.aes"
|
||||
contract Remote =
|
||||
record rstate = { i : int, s : string, m : map(int, int) }
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
include "String.aes"
|
||||
contract Strings =
|
||||
entrypoint str_len(s) = String.length(s)
|
||||
entrypoint str_concat(s1, s2) = String.concat(s1, s2)
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
// AENS.transfer
|
||||
// AENS.revoke
|
||||
// Oracle.extend
|
||||
include "String.aes"
|
||||
contract UnappliedBuiltins =
|
||||
entrypoint main() = ()
|
||||
type o = oracle(int, int)
|
||||
|
||||
Reference in New Issue
Block a user