Http.cookie.put: def of bend-kit-http@0.38.2.0 Import: import bend-kit-http@0.38.2.0/http.bend as Http Lines 2356-2363 of bend-kit-http@0.38.2.0/http.bend: https://jend.leeeet.dev/read.txt?path=bend-kit-http@0.38.2.0/http.bend&start_line=2356&end_line=2363 import Base # cs with the cookie c replaces swapped for c (keeping its place, so its creation order), or c last. # A c that is not live only removes the old one: that is how a server deletes a cookie. def cookie.put(cs: List<&2, Cookie>, +c: Cookie, +live: Bool) -> List<&2, Cookie>: match cs: case Nil{}: Bool.pick(List<&2, Cookie>, live, [c], Nil{}) case Con{+o, +t}: Bool.pick(List<&2, Cookie>, cookie.same(o, c), Bool.pick(List<&2, Cookie>, live, Con{c, t}, t), Con{o, cookie.put(t, c, live)}) Uses (5): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.2.0/http.bend&name=Cookie https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.2.0/http.bend&name=cookie.same