Skip to content

Functional interface with the same aliases as ADJUST-TIMESTAMP? #86

@phmarek

Description

@phmarek

ADJUST-TIMESTAMP takes specifications with :SEC, :MINUTE, :HOUR etc. (why :MINUTE and not :MIN, btw?) to change data; but the getter functions are TIMESTAMP-SECOND, TIMESTAMP-MINUTE, TIMESTAMP-HOUR etc.

It would be nice to have either SETF functions with the same names (TIMESTAMP-SECOND etc.), or to have a function that uses the specifications from ADJUST-TIMESTAMP (a copy of %CONSTRUCT-TIMESTRING looks like a good candidate), to have a consistent way to access the parts of a timestamp.

The (TIMESTAMP-PART :SEC) version might be easier to use, as a single part name is sufficient for both getting and setting; the SETF TIMESTAMP-SECOND idea would again need passing two different functions on to the function.
(Yeah, I could do (FUNCALL (ENSURE-FUNCTION (list 'setf name)) new-value timestamp), but that's not so nice, is it?)

Well, one common way to get/set things would be nice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions