Hello. In this language, shebang can only be a single line (see
factor/core/lexer).

пн, 28 сент. 2026 г. в 11:12, toastal <[email protected]>:

> I want to use nix-shell which allows getting all tooling for a script
> <https://nix.dev/manual/nix/2.34/command-ref/nix-shell.html#options>.
> I’m trying to do
>
>     #!/usr/bin/env nix-shell
>     #!nix-shell ./env.nix -i factor
>     USE: io
>     IN: hello-world
>
>     : hello ( -- ) "Hello world" print ;
>
>     MAIN: hello
>
> But when trying to exec my new script, I get
>
>     2: #!nix-shell ./env.nix -i factor
>               ^
>     No word named '#!nix-shell' found in current vocabulary search path
>
> The error makes sense if multiline shebangs aren’t supported (yet), but
> I think this a bug & probably trivial fix.
>
> ------------------------------------------------------------------------
>
> NOTE: I would prefer to use plain `nix-shell -i factor` but the factor
> the binary ends up with a lower priority than `factor` from GNU
> coreutlis — which means I have to do a hack with an ./env.nix file:
>
>     { pkgs ? import <nixpkgs> { } }:
>
>     let
>         inherit (pkgs) lib factor-lang mkShellNoCC nix nixfmt;
>     in
>     mkShellNoCC {
>         buildInputs = [
>            (lib.hiPrio factor-lang.override { guiSupport = false; })
>            nix
>            nixfmt
>         ];
>     }
>
>
>
> _______________________________________________
> Factor-talk mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to