Skip to content

avoid duplication of side effects in upf? #1

@gasche

Description

@gasche

The README says:

Note that ppx_update is simple, so if you update with a long expression, that expression will be computed twice.

Maybe you could fix this in the syntax extension so that users don't have to worry about it?

Currently you generate code that looks like if <lexpr>.f == <rexpr> then () else <lexpr>.f <- <rexpr>, but I suppose you could just as easily generate let field = <rexpr> and obj = <lexpr> in if obj.f == field then () else obj.f <- field, which does not suffer from this issue.

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