Skip to content

Instantly share code, notes, and snippets.

(* 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)
*)
# 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
;; 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)
;; 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
#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 )