MeAmAnUsername / pie

Pipelines for Interactive Environments
Apache License 2.0
0 stars 0 forks source link

More versatile imports #51

Open MeAmAnUsername opened 4 years ago

MeAmAnUsername commented 4 years ago

Allow more things with imports. This would increase the ergonomics of the language as it removes some common annoyances

sub issues

MeAmAnUsername commented 4 years ago

Use case: #18 and #47 would simplify

func ... = {
  ...
  val cppPerAlgorithm = [compileIrToDistCpp(ir) | ir <- algorithms];
  ...
}

func compileIrToDistCpp(ir: spoofax:IStrategoTerm) -> string = {
  val compiled = oracle:distir:spoofax:task:compileIrToDist(ir);
  val result = oracle:cpp:spoofax:task:prettyPrintAst(compiled);
  result
}

to

import oracle:distir:spoofax:task:compileIrToDist as compileToDist
import oracle:cpp:spoofax:task:prettyPrintAst as printCpp

func ... = {
  ...
  val cppPerAlgorithm = [printCpp(compileToDist(ir)) | ir <- algorithms];
  ...
}