Skip to content


Subversion checkout URL

You can clone with
Download ZIP


'unknown operand' on OS X #3

zyxar opened this Issue · 5 comments

2 participants


compilation is smooth, with libtecla installed. However, when invoking oh, it initially prints [: ]: unknown operand, and then the prompt '>'. What's worse, the 'script' mode does not work, in which the oh shell only prints the warning mentioned above, then exits.

I've used grep to see where the warning comes from. However the go src and oh do not contains this string.

I believe the warning is produced around the function engine.go/Evaluate.

btw, Linux does not have this issue.


@michaelmacinnis the scrips were from the subdir examples of oh.
My mistake, the script mode works.
But the annoying warnings also exists in script mode, like the title message of this. I was wondering whether it came from zsh. But invoking from bash does not eliminate the warning.

  • Using strings /bin/zsh | grep operand, or strings /bin/zsh | grep unknown would show positive results, but not exact unknown operand.
  • As oh is only linked against libtecla, libncurses, and libSystem.B here on OS X, strings utility does not indicate other positive answers.

BTW, the import-prime.oh gives an error message:
oh: interface conversion: *main.Pair is not main.Interface: missing method Access


the import-prime.oh issue was caused by import "./examples/another-prime.oh", so that this script can only be executed under top directory. but error message is confusing...


@michaelmacinnis the annoying warning is caused by the last sentence of raw string in engine.go: [ -r (add $HOME /.ohrc) ] && source (add $HOME /.ohrc). The reason is similar to the post I mentioned above.

the workaround is changing this line to :

test -r (add $HOME /.ohrc) && source (add $HOME /.ohrc)

BTW (both on Linux and OS X):

  • add in oh:
    "oh: interface conversion: *main.Pair is not main.Atom: missing method Add"

  • source in oh:
    it would create a file named () in pwd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.