#| <br>Hello all, in a quest for greater concision, I'm looking for a way to abstract over the following code containing mostly definitions. Is there an accepted practice for abstraction over definition introduction?|#<br>
<br>(define top-right-x <br> (lambda (a-grid-plane a-cell)<br> <br>;;The next three definitions are what I am looking to abstract over, as they show up in many similarly defined functions.|#<br> (match-define (cell row-pos col-pos) a-cell)<br>
<br> (define cell-size (grid-plane->cell-size a-grid-plane))<br> <br> (match-define (size cell-w cell-h) cell-size)<br> <br> (+ cell-w <br> (* col-pos cell-w))))<br><br>(define top-right-y <br>
(lambda (a-grid-plane a-cell)<br> <br> (match-define (cell row-pos col-pos) a-cell)<br> <br> (define cell-size (grid-plane->cell-size a-grid-plane))<br> <br> (match-define (size cell-w cell-h) cell-size)<br>
<br> (* row-pos cell-w)))<br><br>#|How should I approach this? are my options parameters, leaving as is, a with- macro? <br><br>Much appreciated all, <br>-Patrick <br>|#<br><br><br>