Skip to content
This repository has been archived by the owner on Oct 10, 2022. It is now read-only.

Change syntax of New API in pmem package #8

Open
jerrinsg opened this issue Apr 27, 2019 · 0 comments
Open

Change syntax of New API in pmem package #8

jerrinsg opened this issue Apr 27, 2019 · 0 comments

Comments

@jerrinsg
Copy link
Contributor

The syntax of the new API is currently a bit confusing. There was a suggestion in the last group meeting to pass some special type argument as the second argument of New instead of the variable name itself.

i.e., Instead of

var head *node
pmem.Init("database")
head = (*node)(pmem.New(”hd", head))

we could have something like

var head *node
type := pmem.Type(head)
head = (*node)(pmem.New(”hd", type))

What pmem.Type returns could very well be head itself but this code snippet looks more readable.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant