scastie_old icon indicating copy to clipboard operation
scastie_old copied to clipboard

print result of every expression in paste

Open OlegYch opened this issue 8 years ago • 3 comments

like worksheet in eclipse/intellij does

OlegYch avatar Oct 21 '16 00:10 OlegYch

I have a prototype for this in: https://github.com/OlegYch/scastie/pull/6/commits/67416bd4a694aaacd3bacef484ddbc75f49f2a08

The disadvantage of this method is that you need to provide an implementation for the instrumentation for each Scala release. In dotty we would need to find another way to do the implementation since macros are gone. We could use a rewrite rule for example.

MasseGuillaume avatar Oct 21 '16 13:10 MasseGuillaume

solved !

instrumentation demo

https://github.com/OlegYch/scastie/pull/6/commits/a4c83e03eab6a4d7e1195a95727dd209922176c1

It works at the syntax level (think String => String). It supports all targets and is independent of the scala version. The drawbacks are type safety/ macro hygiene and the shifting of error messages.

MasseGuillaume avatar Nov 03 '16 13:11 MasseGuillaume

I'm reopening since it's not yet deployed. See https://github.com/OlegYch/scastie/projects/1 for the deployment status.

MasseGuillaume avatar Nov 03 '16 13:11 MasseGuillaume