question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotr should exec scripts

See original GitHub issue

Consider script below

// script.scala
def truth(): Int = 42
println(truth())

In Scala, we can use command scala to exec it directly.

$ scala script.scala 
42
$ 

But dotr could not identify bare script, and it complains

$ dotr script.scala 
Error: Could not find or load main class script.scala
$ 

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
philwalkcommented, Feb 28, 2020

I have never been able to get ammonite to work in windows, whereas generic scala scripting works just fine, and I use it quite a bit. My preference would be for script syntax to be 100% scalac compatible without special “script-only” syntax, which implies (among other things) that the compiler ignore a hash-bang line, and that scripts be permitted to declare a package. I would be willing to contribute to this, fwiw.

1reaction
deanwamplercommented, Feb 20, 2020

+1 for fixing this. It’s a major pain for us book writers who have most examples in script form.

Read more comments on GitHub >

github_iconTop Results From Across the Web

F# Interactive (dotnet) Reference - Microsoft Learn
Learn how F# Interactive (dotnet fsi) is used to run F# code interactively at the console or to execute F# scripts.
Read more >
unix command line execute with . (dot) vs. without
Running the script as an executable gives it its own process. This matters most if you are trying to set environment variable in...
Read more >
DOTr-PRI UNCONTROLLED COPY
The number of SMOS, GES, and PAOS shall be under the discretion of the Executive. Director of PRI depending on the number of...
Read more >
How and When to Use the Dot Command in Bash? - Shell Tips!
... difference between the dot command (.) and a dot file notation. This post cover how and when you should leverage the dot...
Read more >
Malolos-Clark Railway Project: Facility Administration Manual
The DOTr will be the executing agency for the project. A project management office (PMO) ... its mandate and Executive Order 152 as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found