tobogganSe connecter

louise

The Louise language: compiler, runtime, std, tooling

Clone avec HTTPS, un jeton personnel en mot de passe, ou avec SSH, une clé ajoutée dans vos paramètres.

Std: list sort/take/drop/find, string.slice, http.url_encode (issue #297)

list.sort and list.sort_by are a stable merge sort: split by length
(alternating split would not be stable), merge preferring the left
element on Eq. sort is sort_by with the Ord trait's compare; sort_by's
comparator is effect-polymorphic (fn(a, a) -> Order / <e>). take, drop
and find mirror iter.take's edge semantics: n <= 0 is empty/whole,
n >= length is whole/empty.

string.slice(s, start, end) is by characters (as string.length counts
them), bounds clamped to 0..length and empty when end <= start, as
bytes.slice clamps. New tl_string_slice extern over a char_slice kernel
in louise_rt_prims: one pass over the bytes, stopping at end.

http.url_encode percent-encodes every byte outside the RFC 3986
unreserved set (A-Z a-z 0-9 - _ . ~) as %XX, uppercase hex; a space is
%20, not + (url_decode maps both back, and + decodes as a space only in
a query or form, so %20 is the safe spelling in a path). Encoding is
not idempotent (% becomes %25); url_decode(url_encode(s)) == s, tested
over arbitrary unicode. Mirrors url_decode's three layers: the
url_needs_encode/url_encode_into kernels in louise_rt_prims, an owned
tl_url_encode extern that returns a clean string as is, and the
interpreter entry; both externs are in louise_core's table and
louise_rt.h.

olivier · il y a 1 mois · 4d894e287fc33e352b2374db07f0a7beed816f2a

Parents 0a1c9ae

11 fichiers modifiés, 446 ajouts, 1 suppressions