AlgebraicJulia / AlgebraicRelations.jl

Relational Algebra, now with more algebra!
https://www.algebraicjulia.org
MIT License
48 stars 3 forks source link

uniquify might could use gensym? #9

Open jpfairbanks opened 3 years ago

jpfairbanks commented 3 years ago

I saw this helper function uniquify and it looks like you are manually creating unique symbols. Julia provides a builtin for that called gensym which makes symbols.

julia> gensym("foo")
Symbol("##foo#253")

it looks like you can't use # in SQL identifiers, so maybe gensym and then replace would work like:

replace(gensym(tag), "#"=>"_")
bosonbaas commented 3 years ago

This is good to know. Originally I was concerned about readability issues (making sure that uniquify just iterates when copies are found), but I think that gensym will have a natural place in the new ACSet refactored work.