This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* Homework 7, hw7.sml (see also Ruby code) *) | |
(* Do not make changes to this code except where you see comments containing | |
the word CHANGE. *) | |
(* expressions in a little language for 2D geometry objects | |
values: points, lines, vertical lines, line segments | |
other expressions: intersection of two expressions, lets, variables, | |
(shifts added by you) | |
*) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Jorge Conde V00723209 | |
# Assignment #7 | |
# a little language for 2D geometry objects | |
# each subclass of GeometryExpression, including subclasses of GeometryValue, | |
# needs to respond to messages preprocess_prog and eval_prog | |
# | |
# each subclass of GeometryValue additionally needs: | |
# * shift |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Jorge Conde V00723209 | |
;; Programming Languages, Homework 5 version 1.1 | |
#lang racket | |
(provide (all-defined-out)) ;; so we can put tests in a second file | |
;; definition of structures for MUPL programs - Do NOT change | |
(struct var (string) #:transparent) ;; a variable, e.g., (var "foo") | |
(struct int (num) #:transparent) ;; a constant number, e.g., (int 17) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Jorge Conde V00723209 | |
;; Programming Languages, Homework 5 | |
#lang racket | |
(provide (all-defined-out)) ;; so we can put tests in a second file | |
;; definition of structures for MUPL programs - Do NOT change | |
(struct var (string) #:transparent) ;; a variable, e.g., (var "foo") | |
(struct int (num) #:transparent) ;; a constant number, e.g., (int 17) | |
(struct add (e1 e2) #:transparent) ;; add two expressions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(provide (all-defined-out)) ;; so we can put tests in a second file | |
;; put your code below | |
(define (sequence low high stride) | |
(if (> low high) | |
(list ) |