Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 30 2019 14:37
    bhaskarmelkani starred lihaoyi/Ammonite
  • Jan 29 2019 04:27
    JYInMyHeart starred lihaoyi/Ammonite
  • Jan 29 2019 04:27
    JYInMyHeart starred lihaoyi/Ammonite
  • Jan 28 2019 15:07
    ishubelko starred lihaoyi/Ammonite
  • Jan 25 2019 22:38
    borissmidt starred lihaoyi/Ammonite
  • Jan 25 2019 17:12

    alexarchambault on 1.6.3

    (compare)

  • Jan 25 2019 17:11

    alexarchambault on master

    1.6.3 (compare)

  • Jan 25 2019 15:48
    alexarchambault commented #923
  • Jan 25 2019 01:15

    lihaoyi on gh-pages

    5ad9ae5538f23cab92ccd8c6b1617d8… (compare)

  • Jan 25 2019 00:50

    alexarchambault on master

    Partly revert 84d48542 (#923) … (compare)

  • Jan 25 2019 00:50
    alexarchambault closed #923
  • Jan 25 2019 00:50
    alexarchambault closed #920
  • Jan 25 2019 00:50
    alexarchambault closed #922
  • Jan 24 2019 23:13
    lihaoyi commented #923
  • Jan 24 2019 22:39
    alexarchambault closed #921
  • Jan 24 2019 22:39
    alexarchambault commented #921
  • Jan 24 2019 22:39
    alexarchambault edited #923
  • Jan 24 2019 22:38
    alexarchambault opened #923
  • Jan 24 2019 22:37
    david-bouyssie commented #919
  • Jan 24 2019 21:33
    nksureshkumar commented #922
philbertw4
@philbertw4
it works fine in the ammonite REPL itself, but in the worksheet it seems to not be able to fine $plugin so VS Code must be doing something special/non-standard I suppose
Tobias Roeser
@lefou
In mill we use currently ammonite 2.3.8-4-88785969. Simple forward upgrades didn't succeed because of refactoring in ammonite. Is there any documentation about these changes or can you provide a guide how to migrate?
Alex Fox Gill
@alexfoxgill
hey, how do i insert a tab character in the repl? pressing the tab key just prompts autocomplete
1 reply
Li Haoyi
@lihaoyi
@lefou @alexarchambault did the refactoring. Mill integrates with Ammonite more deeply than most things, so we'll probably have to dig through the code. It's probably mostly renamings...
3 replies
Tobias Roeser
@lefou
Any plans to support Scala 2.13.5 ?
zeroexcuses
@zeroexcuses
I would like to embed an Ammonite REPL inside a Scala/Swing application. (Two text areas, one for output, one for input). Is there sample/example code for doing this?
Daniel Schoepe
@dschoepe

I'm trying to add ammonite as a dependency to an SBT project by adding libraryDependencies += "com.lihaoyi" % "ammonite" % "2.3.8" cross CrossVersion.full but I'm getting the following error on sbt compile (using sbt 1.4.7 and Scala 2.12.13):

[info] Updating 
[info] Resolved  dependencies
[warn] 
[warn]  Note: Unresolved dependencies path:
[error] stack trace is suppressed; run last update for the full output
[error] (update) sbt.librarymanagement.ResolveException: Error downloading com.lihaoyi:ammonite_2.12.13:2.3.8
[error]   Not found
[error]   Not found
[error]   not found: /Users/schoeped/.ivy2/localcom.lihaoyi/ammonite_2.12.13/2.3.8/ivys/ivy.xml
[error]   not found: https://repo1.maven.org/maven2/com/lihaoyi/ammonite_2.12.13/2.3.8/ammonite_2.12.13-2.3.8.pom

Did anyone else ever run into a similar issue?

zeroexcuses
@zeroexcuses
@dschoepe : I thought it was % for Java packages and %% for Scala packages -- does this matter for Ammonite ?
1 reply
Tobias Roeser
@lefou
Have you checked that ammonite is published for Scala 2.12.13 ?
Doesn't look like
2.12.9 and 2.13.4 are the latest supported scala 2.x versions
Daniel Schoepe
@dschoepe
@lefou Thanks, I indeed hadn't checked that. I assumed 2.12.13 was supported based on the version matrix on mvnrepository: https://mvnrepository.com/artifact/com.lihaoyi/ammonite
Tobias Roeser
@lefou
@dschoepe The latest snapshot release is available for Scala 2.12.13: 2.3.8-36-1cce53f3
scalway
@scalway

Hello: There are some problems with documentation after switching to com_lihaoyi. Here is what I've found:

on github readme of particular projects:
Ammonite -> there is lot of links to https://lihaoyi.github.io/Ammonite -> (404) //should be?: https://com-lihaoyi.github.io/ or directly https://ammonite.io/
fansi -> wrong redirection to scaladocs (0.2.0) and wrong link to ammonite (same as above)
utest -> there is 1 link that does not work 'Fansi'
sourcecode -> wrong (very old?) link to PPrint (https://www.lihaoyi.com/upickle-pprint/pprint) FastParse (http://lihaoyi.github.io/fastparse/) and Scalatags (http://lihaoyi.github.io/scalatags/#CSSStylesheets)
cask -> link to documentation does not work (https://www.lihaoyi.com/cask/)
requests-scala -> all links in sentence "such as ujson.Values, uPickle's upickle.default.writable values, or Scalatags's Tags" are dead (https://www.lihaoyi.com/upickle, https://www.lihaoyi.com/scalatags/) and other references to uJson

Those seams to works:
upickle, acyclic, FastParse, scalatags

Tobias Roeser
@lefou
There is already a PR fixing some of the links in documentation.
scalway
@scalway
:)
Dominik Dorn
@domdorn
Hi! Is anyone here? I'm having trouble running a very simple ammonite script that uses zio, hope someone has a clue?
import $ivy.`dev.zio::zio:1.0.4`
import zio._

val program = for {
  _ <- zio.console.putStrLn("starting zio program")
} yield ()

println("should run program now")
println(program)
zio.Runtime.default.unsafeRun(program.provideLayer(zio.ZEnv.live)) // here it just blocks and does nothing!
println("should have run program now")
Anton Sviridov
@velvetbaldmime:matrix.org
[m]
First thing I'd suggest to try is putting the unsafeRun part into an Ammonite's @main method, instead of script's body.
I often encounter this problem with things like CE/fs2.
Dominik Dorn
@domdorn
this seems to do the trick, thanks!
Dominik Dorn
@domdorn
hmm.. is it known that the links in the docs to upickle are dead/wrong ?
oh, @scalway just posted the same.
Tobias Roeser
@lefou
Most projects moved to new github org com-lihaoyi.
I vaguely guess, that you can probably speed up PR application by reviewing / commenting it.
technillogue
@technillogue
Hi, is it possible to save the current session persistently? or at least write the history to a file? I need to restart and really don't want to loose my state
Sakib Hadžiavdić
@sake92
seems like source command is broken? At least on windows..
"value browseSourceCommand is not a member of object ammonite.compiler.tools.SourceRuntime"
Sakib Hadžiavdić
@sake92
Is debugging section still relevant? https://ammonite.io/#Debugging
Can't find any references in code :/
scalway
@scalway
@sake92 source seams to work on Linux. At least simple cases.
scalway
@scalway

I've question if there is a way to get help message of a script

Missing argument: --time <int>
Expected Signature: lines
  --time <int>
  cmd <str>...

without calling it. I mean if script has some side effects

println("side effect")
@main def lines(time:Int, cmd:String*) = { ... }

they are performed, even if @main def lines(t:String) = {} wasn't called.

scalway
@scalway
Next question: What is currently prefered IDE to ammonite scripts for newbies? Is Idea the only choice?
Anton Sviridov
@velvetbaldmime:matrix.org
[m]
Not sure about the first question, but in my experience Ammonite support in Metals supported editors (especially VS Code) has been superior to IJ
scalway
@scalway
@velvetbaldmime:matrix.org thanks. I'll check it out then :).
I need to optimize for installation time/hassle (workshop) and when I've tried Metals last time it was quite harsh, but hopefully it is better now.
scalway
@scalway
Next question (mostly to contributors):
In readme.md in Common Commands/Manual Testing there is line mill -i amm[2.12.6].launcher creates a launcher script at out/amm/2.12.6/launcher/dest/run that can also be used to run Ammonite outside of the Mill build tool.
but full path is /out/amm/2.12.6/launcher/overriden/mill/scalalib/JavaModule/launcher/dest/run. Is it intendet to have that extra overriden/..?
Anton Sviridov
@velvetbaldmime:matrix.org
[m]

With regards to installation, having JDK on the machine and then Installing VS Code, installing Metals extension - should be enough.

It bootstraps itself out of a Coursier launcher script so it should be painless.

Sergey Nastich
@einholen

Hey all! Is there a workaround to Ammonite not being able to disambiguate the same import when it occurs in multiple files with and without "^"?

So for a directory structure like this

- /common
  - commonDep.sc
- /something
  - reusedScript.sc
myScript.sc

where

  • myScript.sc imports both common.commonDep and something.reusedScript,
  • and reusedScript.sc imports ^.common.commonDep

I'm getting the following compile error:

myScript.sc:78: type mismatch;
 found   : ammonite.$file.common.commonDep
 required: ammonite.$file.something.^.common.commonDep
    dep = dep,
          ^
Compilation Failed
Darren Bishop
@DarrenBishop
Hi all. Has 2.3.8 actually been released yet? The home page suggests it is, but only snapshots (i.e. 2.3.8-58-aa8b2ab1/) seem to be in Central
you're probably on Scala 2.13.4 or newer. It's not released for these versions.
Siddhant Sanyam
@siddhant3s
It it possible to be in Ammonite and re-import a class? Let's say I update the .class file which is on the class path, is it possible to Ammonite to pick up those changes?
import com.foo.bar.StateMachine

val m = StateMachine(42)
val compiled = m.compile()
//////// Make changes to StateMachine.scala in the def compile  and trigger a build loop so that StateMachine.class is updated///
val m = StateMachine(42)
val compiled = m.compile() // <-------- Compiled using new code.
scalway
@scalway
@siddhant3s maybe for such cases --watch will be usefull? https://ammonite.io/#WatchandReload
Or try to import this class again.
Siddhant Sanyam
@siddhant3s
--watch will simply execute my script again and again. I simply want to load it.
Darren Bishop
@DarrenBishop
Thanks Tobias, yes I think that client had bumped to 2.13.5
Miguel Vilá
@miguel-vila

hey, qq, just got a compilation error from a type mismatch which should be the same type but it might appear a different type because they are imported from different modules:

  • main file: import $file.folder.moduleName.type
  • other file (contained in a different folder): import $file.^.folder.moduleName.type
    main has code that invokes other file passing a $file.folder.moduleName.type but expects a $file.^.folder.moduleName.type, which should be the same type.

Shouldn't this compile?

Matthew de Detrich
@mdedetrich
When using --predef to load scripts into ammonite, does anyone know if its possible to access args without the @main method?
For understandable reasons, the @main isn't even executed in a file that is passed into --predef however I want to do some logic in --predef based on command line arguments