Fork me on GitHub
#off-topic
<
2016-04-28
>
lmergen06:04:37

off-topic bikeshed question: is there an official name for a "create-or-get" function ? how would you name it, just create-or-get to keep it simple and clear ?

arnaudbos07:04:20

@lmergen: Just a guess but I think the name would more semantically correct the other way around. Also I haven't done much python for a while now but django has this get_or_create method that I found appropriate: "Returns a tuple of (object, created), where object is the retrieved or created object and created is a boolean specifying whether a new object was created." https://docs.djangoproject.com/en/dev/ref/models/querysets/#get-or-create

arnaudbos07:04:39

IDK if there's any Clojure specific answer though.

lmergen07:04:49

i think you're right, because you first get, and if nil, you create

lmergen07:04:07

i had already settled on that, for exactly the same reason ("django project uses it")

akjetma09:04:35

“Clojourneyman"

telent10:04:25

successor to "Apprentij"?