Skip to content

is project alive? #37

Closed
Closed

Description

@andyglow
No description provided.

Activity

  1. pettermahlen commented on Sep 7, 2023

    @pettermahlen
    Member

    Yes, but we're not making a lot of active changes to it. It's been mostly used in Android projects, and there are very few remaining usages since we've been moving to Kotlin and sealed classes instead.

  2. andyglow commented on Sep 7, 2023

    @andyglow
    ContributorAuthor

    I see.
    But still, would you be open to accept couple of PRs?

    • I am looking for the way to make sure that adt members are Serializable. Or more generally speaking I'd like to be able to instruct the spec with all the interfaces that need to be implemented by members. Basically need to copy them exactly the same way you copy type parameters.
    @DataEnum
    public interface Expr_dataenum extends Serializable {
      dataenum_case Lit(int i);
      dataenum_case Sum(Expr_dataenum l, Expr_dataenum r);
      dataenum_case Mul(Expr_dataenum l, Expr_dataenum r);
    }
    
    • and another one. allow default methods on spec interface which won't affect the values, but instead would be just copied to the base adt class
    @DataEnum
    public interface Expr_dataenum extends Serializable {
      dataenum_case Lit(int value);
      dataenum_case Sum(Expr_dataenum l, Expr_dataenum r);
      dataenum_case Mul(Expr_dataenum l, Expr_dataenum r);
    
      default int eval() {
        return map(
          lit -> lit.value(),
          sum -> sum.l().eval() + sum.r().eval(),
          mul -> mul.l().eval() * mul.r().eval(),
        );
      }
    }
    

    what do you think?

  3. andyglow commented on Sep 10, 2023

    @andyglow
    ContributorAuthor

    @pettermahlen please check if this is something that can be considered a candidate to merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions