Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    andrewchambers
    @andrewchambers
    (sh/alias ls (fn ls [&args] ...))
    at least pretty use you can
    sure :P if not, it is a bug
    oh darn, it is a bug. For now you need to do this -
    (put sh/*aliases* "ls" [(fn ...)] )
    I didn't intend that, but I just realized you can use it to write mini functions
    in your rc file
    like git-foobar ...
    or something
    maybe not git-foobar , but I perhaps can use it to automate some github stuff
    andrewchambers
    @andrewchambers
    I suppose you could just write a file to disk lol, nvm :P
    user defined builtins can do more too
    andrewchambers
    @andrewchambers
    Implemented the 'exec' builtin that bash has
    so you can go
    (sh/exec :2> '1)
    or (sh/exec ls )
    sorry
    (sh/$ exec ...)
    technically you can exec in a pipeline, but it makes no sense
    andrewchambers
    @andrewchambers
    The last two features for 0.1 I want, non linear pipelines, and spawning processes and getting access to the FD's
    they might be related or not, trying to think how they should work
    andrewchambers
    @andrewchambers
    basically, how would you spawn netcat and connect it to a janet/sh repl
    without the -e command
    and also things like
    from bash you can do
    cat <(ls)
    But i think you can do
    cat < <(ls)
    which are slightly different
    though that is different again
    andrewchambers
    @andrewchambers
    For a second I was imagining something like:
    (procs
      :a ($ ls )
     :b ($ cat < :a)
    )
    Probably too crazy.
    a simple way might just be
    (let [[a b] (pipes)]  ($ ls > [a] &) ($ cat < [b]))
    andrewchambers
    @andrewchambers
    I am a fan of this simple way, even if it a bit manual, it seems easy to implement, and doesn't require much change at all.
    andrewchambers
    @andrewchambers
    andrewchambers
    @andrewchambers
    Woo
    now we can redirect into core/file
    andrewchambers
    @andrewchambers
    it's done
    andrewchambers
    @andrewchambers
    Another fun idea
    expand core/file instances on the command line to /dev/fd/N
    (that is why I was thinking about multimethods)
    so users can define how their own types get expanded into command line arguments
    pauldub
    @pauldub
    That would be a very nice feature
    andrewchambers
    @andrewchambers
    yeah, not too sure what other uses there are
    but there must be some good ones
    pauldub
    @pauldub
    It would be a nice interaction point between tools written in janet and the shell itself
    andrewchambers
    @andrewchambers
    One example I can think of is a bit like the nix package manager. A nix package is like table, but when expanded into a command line it becomes a path to the package
    the fd one is still the most useful, it lets you work around poorly written tools