Fork me on GitHub
#datomic
<
2018-09-30
>
hmaurer00:09:15

@solussd don’t you find it problematic to be completely duck-typed in this way?

Joe R. Smith00:09:27

I wouldn’t call it duck typing, per se. Those attributes have type and they’re part of the datomic schema and mean something. I.e., a datomic attribute should only have one semantic meaning. Practically though, no, it’s worked quite well for me. :) W.r.t. the entities possibly being of multiple entity “types”, it’s set membership / set semantics for typing.

octahedrion08:10:47

we've found the same thing: instead of thinking in terms of types think in terms of qualities of things -- everything is a composite of multiple qualities

octahedrion08:10:52

still, it's convenient to have a :kind attribute for some things

hmaurer00:09:15

@solussd oh; what I meant is that, with this approach, it seems to me quite hard to ensure that specific attributes are present on certain entities. i.e. that a “first name” and “last name” is provided for an entity that acts as a “person”, etc

hmaurer00:09:21

(but my experience is very limited)

Joe R. Smith00:09:57

@hmaurer ah, I suggest using transaction functions as entity constructors. That’s the idiomatic way of ensuring a particular shape for a particular kind of entity in datomic.

hmaurer00:09:13

@solussd oh interesting; thanks! I’ll look into this

hmaurer00:09:34

when you say idiomatic, can you point at some articles/talks/projects that do this?

hmaurer00:09:37

out of curiosity