Clojure

Improve docstring of clojure.java.io/delete-file to be clearer about intent of silently arg

Details

  • Type: Enhancement Enhancement
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: Release 1.5
  • Fix Version/s: None
  • Component/s: None
  • Labels:
  • Environment:
    any
  • Patch:
    Code
  • Approval:
    Prescreened

Description

clojure.java.io/delete-file docstring takes an optional second arg `silently` and says:

Raise an exception if it fails unless silently is true.

This is confusing. The intent is that in the case of a failure, it will by default throw an exception. Or if the optional second arg is supplied and truthy, it will be returned instead.

Initially reported: https://groups.google.com/d/msg/clojure/T9Kvr0IL0kg/wcKBfR9w_1sJ

Approach: Make docstring sentence clearer per Stu's suggestion in comments:

If silently is nil or false, raise an exception on failure, else return the value of silently.

Patch: clj-1159.patch

Activity

People

  • Assignee:
    Unassigned
    Reporter:
    AtKaaZ
Vote (0)
Watch (1)

Dates

  • Created:
    Updated: