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
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
Erik Vesterlund
@erikv85
Hi. The scala repl has the :type functionality, while ammonite does not (it would seem). Any chance it will be supported soon?
scala> :h type
display the type of an expression without evaluating it

scala> val x = 1
val x: Int = 1

scala> :type x
Int
Maatary
@Maatary
Hi all,
wondering how do you read an java InputStream with ammonite. The documentation says that it supports it, but i can't seem to make it work
Could someone provide the code snippet for it
There is no direct example of it in the doc, as far as i can tell
Erik Vesterlund
@erikv85

Hi all,
wondering how do you read an java InputStream with ammonite. The documentation says that it supports it, but i can't seem to make it work

Could you be more specific what it is you want to do?

Maatary
@Maatary
read! aFileInputstream
Gernot Ohner
@gernot-ohner
Hi,
This seems like it should be a very frequent question, so I'm sorry if this is a duplicate, but I had a hard time searching for it:
I'm in Ammonite REPL and trying to list the contents of a directory called "abc-def"
ls! pwd/'abc-def
but that doesn't work, because Ammonite thinks thinks the folder name stops at the -
Is there any way to make this work?
Olivier Mélois
@Baccata
@gernot-ohner, ammonite embeds os-lib : https://github.com/com-lihaoyi/os-lib, so you can do os.list(os.pwd / "abc-def")
1 reply
Daniel Sebban
@dsebban_twitter
I am wondering, is there a way to get tab autocompletion for flags in scala-scripts ? zsh gives auto completion for all commands like grep is there a way to get the same behaviour for my .sc ?