Open njordhov opened 3 years ago
Now is an opportune time to change the naming, given the breaking changes to define-map
in https://github.com/blockstack/stacks-blockchain/pull/2115
I like table
as a similar concept to var
that builds the state of the contract
I like data-map
and its consistency with data-var
.
I like data-map and its consistency with data-var.
The word data
is a bit redundant in both, though, to the point of being nearly meaningless.
I like data-map and its consistency with data-var.
with data-map
with have map-get
, like we have var-get
. Does not change confusion with map
function.
I like data-map and its consistency with data-var.
@lgalabru Does your liking of the term data
here have to do with that both defines persistent data aka state?
I'd like define-state-map
/ define-state-var
equally, so it's really about consistency between these 2 concepts.
The
define-map
syntactic form defines associative persistent state, but the name can be confusing given themap
function and the more general concept of amap
datastructure.Renaming
define-map
and its related functions (map-delete
map-get?
map-insert
map-set
) will avoid the confusion, as in:define-table
table-delete
table-get?
table-insert
table-set
ordefine-state
state-delete
state-get?
state-insert
state-set