Sudha247 / ocaml-joy

MIT License
22 stars 14 forks source link

Syntax error in main branch #47

Closed AryanGodara closed 10 months ago

AryanGodara commented 10 months ago

When I pulled the main branch, I noticed these two issues :-

examples/dune

Current:

(executable
 (name rotate)
 (modules rotate)
 (libraries joy)))

(executable 
 (name line)
 (modules line)
 (libraries joy)

Should be

(executable
 (name rotate)
 (modules rotate)
 (libraries joy))

(executable 
 (name line)
 (modules line)
 (libraries joy))

lib/shape.ml

Missing case for line

let rotate degrees shape = 
  match shape with 
  | Circle circle -> Circle { c = (rot circle.c degrees); radius = circle.radius }
  | Rectangle rectangle -> Rectangle { c = (rot rectangle.c degrees); length = rectangle.length; width = rectangle.width }
  | Ellipse ellipse -> Ellipse { c = (rot ellipse.c degrees); rx = ellipse.rx; ry = ellipse.ry }

Maybe something like:-

  | Line line -> Line {a = (rot line.a degrees); b = (rot line.b degrees)}
joanita-51 commented 10 months ago

Thank you, @AryanGodara, for providing valuable insights into the issues

nikochiko commented 10 months ago

Thanks for debugging! @AryanGodara

Sudha247 commented 10 months ago

Thanks @AryanGodara! We should fix this asap. Any takers for this? :)

AryanGodara commented 10 months ago

Thanks @AryanGodara! We should fix this asap. Any takers for this? :)

Hi @Sudha247 , I believe @kushalpokharel has already implemented the fix in their new PR

Sudha247 commented 10 months ago

Wonderful! I see this is being addressed in #34. Thanks @kushalpokharel!

Sudha247 commented 10 months ago

I believe this is fixed by #34. Thanks @kushalpokharel for fixing it, and @AryanGodara for reporting.