Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.5
    • Fix Version/s: 0.7
    • Component/s: Command line tools
    • Labels:
      None
    • Number of attachments :
      1

      Description

      myren suggested an EvalFile function in the interpreter to evaluate an external script.

      It may be as simple as adding something like this at line 155 in src/Boo.Lang.Interpreter/AbstractInterpreter.boo:

      def EvalFile(fname as string):
      return Eval(Boo.IO.TextFile.ReadFile(filename))

      1. boo-302.patch
        22 kB
        Arron Washington

        Activity

        Hide
        Doug H added a comment -

        def EvalFile(fname as string):
        return Eval(Boo.IO.TextFile.ReadFile(fname))

        Show
        Doug H added a comment - def EvalFile(fname as string): return Eval(Boo.IO.TextFile.ReadFile(fname))
        Hide
        Arron Washington added a comment -

        A slight modification to the proposal:

        I modified the "load" method of the InteractiveInterpreter to check to see whether the user is attempting to load a .boo file or a assembly file; hence, it now works as either loading an assembly (reference) or loading another Boo file.

        This does not handle multiple scripts that have interdependencies--but those sorts of scripts will probably be compiled into an assembly.

        Show
        Arron Washington added a comment - A slight modification to the proposal: I modified the "load" method of the InteractiveInterpreter to check to see whether the user is attempting to load a .boo file or a assembly file; hence, it now works as either loading an assembly (reference) or loading another Boo file. This does not handle multiple scripts that have interdependencies--but those sorts of scripts will probably be compiled into an assembly.
        Hide
        Rodrigo B. de Oliveira added a comment -

        Thanks for the patch!

        Show
        Rodrigo B. de Oliveira added a comment - Thanks for the patch!

          People

          • Assignee:
            Rodrigo B. de Oliveira
            Reporter:
            Doug H
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: