Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Suggestion: c library access



I have a suggestion for a (far) future Zsh enhancement. What if you
could load libraries, and call functions from them on the command line?

Imagine the following script which uses a function float pow(float,float):

---BEGIN---
#!/bin/zsh
LIBM 0 $(((load-library libm)))

return_function c_pow (){
  Y=$(((float-to-shell $(((exec-library-function $LIBM "pow" \
						 $(((shell-to-float $1))) \
						 $(((shell-to-float $2)))))))))
  return Y
}

A=2.0 B=2.0
C=$(c_pow $A $B)

$(((free-library $LIBM)))
---END---

would this be an idea?

-- 
                                                     -jk



Messages sorted by: Reverse Date, Date, Thread, Author