munificent / magpie

The Magpie programming language
http://magpie-lang.org
Other
359 stars 34 forks source link

Exception throws you out of REPL #15

Closed krainboltgreene closed 11 years ago

krainboltgreene commented 12 years ago
$ ./magpie

      _/Oo>
     /__/     magpie v0.0.0
____//hh___________________
   //

Type 'quit()' and press <Enter> to exit.
> val points = x: 1, y: 2
= x: 1, y: 2
> x: _ = points
Exception in thread "main" com.stuffwithstuff.magpie.util.NotImplementedException: Destructuring is only implemented on new vars for now.
    at com.stuffwithstuff.magpie.parser.ConvertAssignmentExpr.visit(ConvertAssignmentExpr.java:108)
    at com.stuffwithstuff.magpie.parser.ConvertAssignmentExpr.visit(ConvertAssignmentExpr.java:12)
    at com.stuffwithstuff.magpie.ast.RecordExpr.accept(RecordExpr.java:24)
    at com.stuffwithstuff.magpie.parser.ConvertAssignmentExpr.convert(ConvertAssignmentExpr.java:16)
    at com.stuffwithstuff.magpie.parser.EqualsParser.parse(EqualsParser.java:10)
    at com.stuffwithstuff.magpie.parser.MagpieParser.parseInfix(MagpieParser.java:92)
    at com.stuffwithstuff.magpie.parser.MagpieParser.parsePrecedence(MagpieParser.java:85)
    at com.stuffwithstuff.magpie.parser.MagpieParser.parseExpression(MagpieParser.java:68)
    at com.stuffwithstuff.magpie.parser.MagpieParser.parseStatement(MagpieParser.java:64)
    at com.stuffwithstuff.magpie.Repl.readAndEvaluate(Repl.java:20)
    at com.stuffwithstuff.magpie.app.ConsoleRepl.run(ConsoleRepl.java:31)
    at com.stuffwithstuff.magpie.app.MagpieApp.main(MagpieApp.java:38)
$
munificent commented 12 years ago

Yeah, this one is a pain. My hope is that I'll be moving away from the Java implementation relatively soon, so I'll leave this open but it may never gets fixed. Once the self-hosted implementation is done, I can bootstrap it with the Java version and ditch the Java code.

krainboltgreene commented 12 years ago

That's exactly what I was thinking. Magpie may be sufficiently developed enough to make a REPL. Sounds like a good weekend project for me.

munificent commented 12 years ago

A Magpie REPL written in Magpie?

munificent commented 11 years ago

The Java implementation is officially on ice now, so I'm closing this out.