4ever-clojure icon indicating copy to clipboard operation
4ever-clojure copied to clipboard

Implement restrictions

Open oxalorg opened this issue 4 years ago • 15 comments

  • [ ] Configure such that an error is thrown for restricted functions, probably by using sci deny
  • [x] Show a warning for restricted functions - #14 solves this

oxalorg avatar Jul 10 '21 21:07 oxalorg

To :deny use below example as reference (eval-string "(first '(1 2 3 4))" {:deny '[inc dec first]})

pradeepbishnoi avatar Jul 11 '21 06:07 pradeepbishnoi

@borkdude Any suggestion how to convert this into a quote for Tried few things however not able to convert it. (first `(~(mapv symbol ["inc" "dec" "last"])))

above expression give a vector with symbol. however want to convert this into a quoted collection for input to :deny.

image

pradeepbishnoi avatar Jul 11 '21 06:07 pradeepbishnoi

Just (mapv symbol ...) should do the trick? Why are you using the backtick?

borkdude avatar Jul 11 '21 07:07 borkdude

@borkdude Yes, it does. I over thought on this one and didn't realise that :deny is just needing a vector. Using the backpack I was trying to create a "quoted" statement to pass 🤦

pradeepbishnoi avatar Jul 11 '21 08:07 pradeepbishnoi