The values of the dimensions can be defined by defining a proper variable (defVar) which has the same name as the dimension and values the values you need.
ds = Dataset("./test.nc","c")
v = defVar(ds, "lon", 15:55, ("lon",))
close(ds)
The dimension is automatically created if you provide directly the data (rather than just the type) to defVar. The first "lon" is the variable name and the second is the dimension name (which are typically the same).