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
Ackerley Tng
@ackerleytng
I see, got it! so it isn't really implicit anymore. Thanks!
Eric K Richardson
@ekrich
JavaConversions were implicit but they are deprecated.
Ackerley Tng
@ackerleytng
I see, thanks!
Matthew de Detrich
@mdedetrich
Is it possible to create a forked process with ammonite-ops?
Li Haoyi
@lihaoyi
you can spawn processes using os.proc().spawn. You cannot fork JVMs https://jukkaz.wordpress.com/2010/05/27/forking-a-jvm/
Matthew de Detrich
@mdedetrich
Thanks
Jonas Amundsen
@badeball
This might be a silly question, but can I import and use a file from a SBT project in a scala-script?
Jason Pickens
@steinybot

I’m trying to follow the steps to add Ammonite to an SBT project. Now when I run Test / compile it fails with:

[error] error while loading Object, Missing dependency 'object scala.native in compiler mirror', required by /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/jre/lib/rt.jar(java/lang/Object.class)
[error] ## Exception when compiling 1 sources to /Users/jason/source/console-api/target/scala-2.13/test-classes
[error] scala.reflect.internal.MissingRequirementError: object scala in compiler mirror not found.
…

This is with sbt 1.3.5 and Scala 2.13.1

Henry Story
@bblfish
Hi @lihaoyi just wondering as your code uses a lot of the symbol notation from Scala2 what you make of its deprecation in Scala3. Did you find a good workaround?
Li Haoyi
@lihaoyi
we’ll just use strings instead
one more character to type is no big deal
we never made use of symbol specific stuff anyway
Henry Story
@bblfish
+1
Adam Fraser
@adamgfraser
Hi. Is there a recommended best practice for avoiding having scripts exit an interactive Ammonite session if they call system.exit? I'm thinking of just checking sys.env for Ammonite being the main class and not doing the exit in that case but wanted to see if there was another recommended way.
Rey
@reyman
hi,

I'm trying to load scala-js-d3v4 lib using ammonite script of @lihaoyi without success,

interp.repositories() ++= Seq(coursierapi.IvyRepository.of("https://jitpack.io"))
import $ivy.`com.github.fdietze:scala-js-d3v4:master-SNAPSHOT`

I have a failed resolving error ... someone use d3 with scala js here ?

Rey
@reyman
i obtain something like that
something like that :
org.xml.sax.SAXParseException; lineNumber: 42; columnNumber: 3; Le type d'élément "meta" doit se terminer par la balise de fin correspondante "</meta>". (Le type d'élément "meta" doit se terminer par la balise
 de fin correspondante "</meta>".)
Joerg von Roos
@jvr-ks

I switched from MINGW64 to WSL / Debian buster on my Win10 laptop today.

Welcome to the Ammonite Repl 1.9.8
(Scala 2.13.1 Java 11.0.5)
If you like Ammonite, please support our development at www.patreon.com/lihaoyi

Great!

One drawback:

I am used to use TABs to format code,

but Ammonite Repl uses TABs for autocompletion in interactive mode.

How can I turn this off ore replace with another key (Shift+Tab?) and use Tabs as Tabs,
besides replacing all TABs with blanks :-) ?

Rey
@reyman
hi @lihaoyi , i'm trying to add jitpack dependency to use scala js D3 with ammonite, i have a org.xml.sax error, i post an issue here, fdietze/scala-js-d3v4#41 , but dev doesn't know why lib is not downloaded by ammonite
Colin Williams
@KE7CFN_twitter
@bblfish I thought I would fiddle with banana-rdf but following https://github.com/banana-rdf/banana-rdf/wiki/Scripting-with-Ammonite and getting import errors.
amm
Loading...
Welcome to the Ammonite Repl 2.0.1
(Scala 2.12.10 Java 1.8.0_232)
If you like Ammonite, please support our development at www.patreon.com/lihaoyi
colin-banana-rdf@ import coursier.core.Authentication, coursier.MavenRepository 
cmd0.sc:1: not found: value coursier
import coursier.core.Authentication, coursier.MavenRepository
       ^
cmd0.sc:1: not found: value coursier
import coursier.core.Authentication, coursier.MavenRepository
                                     ^
Compilation Failed

colin-banana-rdf@  

colin-banana-rdf@ interp.repositories() ++= Seq(MavenRepository(
                    "http://bblfish.net/work/repo/snapshots/"
                    )) 
cmd0.sc:1: value ++= is not a member of List[coursierapi.Repository]
  Expression does not convert to assignment because:
    not found: value MavenRepository
    expansion: {
  <synthetic> val ev$1: ammonite.util.Ref[List[coursierapi.Repository]] = ammonite.interp.api.InterpBridge.value.repositories;
  ev$1.update(ev$1.apply().++(Seq(<MavenRepository: error>("http://bblfish.net/work/repo/snapshots/"))))
}
val res0 = interp.repositories() ++= Seq(MavenRepository(
                                 ^
Compilation Failed
Colin Williams
@KE7CFN_twitter
Colin Williams
@KE7CFN_twitter
That worked. I will update the wiki...
Colin Williams
@KE7CFN_twitter
Is there any set -x when running scala scripts? I found lihaoyi/Ammonite#421 but assume it's related to the REPL, and not scala scripts.
Kyle Prifogle
@kyprifog
Can anyone help me figure out how to structure an import statement for this in ammonite? https://github.com/MrPowers/spark-daria I assume you use $ivy, but that library doesn't seem to be there.
Ben Iofel
@benwaffle
interp.repositories() ++= Seq(coursierapi.MavenRepository.of("http://dl.bintray.com/spark-packages/maven"))

@

import $ivy.`mrpowers:spark-daria:0.35.0-s_2.12`
Kyle Prifogle
@kyprifog
Thank you! the top part was what I was missing
Kyle Prifogle
@kyprifog
Hmm, this doesn't work
Kyle Prifogle
@kyprifog
This worked for me:
import coursier._

val mavenRepo = coursier.MavenRepository("http://dl.bintray.com/spark-packages/maven")
interp.repositories.update(
  interp.repositories() ::: List(mavenRepo)
)
Ben Iofel
@benwaffle
is your version of ammonite out of date?
Kyle Prifogle
@kyprifog
version 2.0.1, from what I read on the issues on github the issue was that my version of ammonite was too up to date
that particular syntax had changed apparently
gavinbaumanis
@gavinbaumanis

I am trying the Machine Learning examples on the website,
When I run;

val tokenData = requests.get(tokenDataUrl)

I get the following - then a whole lot of "binary" data and the shell crashes.

Exception in thread "main" java.lang.IllegalArgumentException: Unknown ansi-escape

Here is the stack trace;

at fansi.ErrorMode$Throw$.handle(Fansi.scala:419)
        at fansi.ErrorMode$Throw$.handle(Fansi.scala:407)
        at fansi.Str$.apply(Fansi.scala:272)
        at fansi.Str$.implicitApply(Fansi.scala:227)
        at ammonite.repl.Repl$.$anonfun$showException$1(Repl.scala:304)
        at scala.collection.immutable.List.map(List.scala:219)
        at scala.collection.immutable.List.map(List.scala:79)
        at ammonite.repl.Repl$.showException(Repl.scala:300)
        at ammonite.repl.Repl$.handleRes(Repl.scala:258)
        at ammonite.repl.Repl.loop$1(Repl.scala:215)
        at ammonite.repl.Repl.run(Repl.scala:223)
        at ammonite.Main.$anonfun$run$1(Main.scala:224)
        at scala.Option.getOrElse(Option.scala:201)
        at ammonite.Main.run(Main.scala:212)
        at ammonite.MainRunner.$anonfun$runRepl$1(Main.scala:408)
        at ammonite.MainRunner.watchLoop(Main.scala:389)
        at ammonite.MainRunner.runRepl(Main.scala:408)
        at ammonite.Main$.main0(Main.scala:307)
        at ammonite.Main$.main(Main.scala:271)
        at ammonite.Main.main(Main.scala)
Chris
@PickledChris
is there a way of compiling a script without running it, so we can check scripts compile (without executing them) in CI?
padhia
@padhia
Are unmodified Ammonite scripts triggering recompilation and re-caching when invoked from a different current working directory a normal behavior? It seems odd for the compiled code to depend on the value of PWD.
Joerg von Roos
@jvr-ks
How can I tell ammonite ops read/write to use the right codec? Tried: implicit val codec = scala.io.Codec("UTF-16LE") but had no success.
Adam Davidson
@Adi255
Hi, sorry if I'm being really dense but I want to stop coursier downloading transitive "-sources" dependencies and I can't see how to do it (I'm downloading from a repo where I don't have permission to get sources)
Adam Davidson
@Adi255
Jonathan Simms
@slyphon
hey is it possible to view or generate the documentation for an older version of ammonite?
we're using ammonite 1.7.4 and i'm trying to figure out how to change the $ivy resolvers to work with our internal repo
Shane Delmore
@ShaneDelmore
I’m not sure if this is the right room to ask Generator questions, but is it possible to implement sliding on a Generator? I was going to reach for sliding to chunk up writes to a database for lines I was reading from a file using os.read, then realized it returns a Generator with no sliding function or toIterator function.
Li Haoyi
@lihaoyi
you can probably implement sliding, but it would have to reurn a Generator[Seq[T]] rather than an iterator
every iterator is a generator, but not vice versa. Generators are a broader category including push-based data sources that cannot be converted to pull-based iterators
Adam Davidson
@Adi255
Further to my above query, is there a reason ammonite needs to get the sources for any ivy dependencies you add? I was under the impression that was only useful for IDEs.
Charlie Hills
@contagnas
@Adi255 https://ammonite.io/#source ammonite is an IDE ;)
Shane Delmore
@ShaneDelmore
Thanks for the explanation @lihaoyi I was mistakenly thinking every Generator was an Iterator, but couldn’t see how. Makes sense now.
Adam Davidson
@Adi255
@contagnas Ah, now I see why it does that thanks. Too bad it breaks the imports when you can't download sources
Ernie Makris
@emakris_twitter
is there a way in ammonite scripts to just show usage without executing anything? Kind like a —help flag?
Jiuyang Liu
@sequencer
Can I package a ammonite xxx.sc into jar?