Skip to content

Operators over mutation forms := #296

Answered by mflatt
kiranandcode asked this question in Q&A
Discussion options

You must be logged in to vote

I don't think that working at a lower level can help here, at least not in a general way. The fact that the left-hand side of := isn't an expression is a more fundamental mismatch with the enforest function, so there would have to be a change to enforest or the way that it is used for expressions.

Copying := doesn't help because the handling of := in ball.x := ... is in the implementation of .. Using the very latest Rhombus, you could change the way . works with specifically x and y for a Ball using the dot class clause, but this doesn't feel like a very good solution:

#lang rhombus/and_meta

class Ball(private mutable _x, private mutable _y):
  opaque
  internal _Ball

  constructor (x, …

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
3 replies
@kiranandcode
Comment options

@mflatt
Comment options

Answer selected by kiranandcode
@kiranandcode
Comment options

Comment options

You must be logged in to vote
1 reply
@mflatt
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants