Hi Leon,

as Alex said above, if you really need something I would recommend adding
it in a library. I'm sure you will encounter more scenarios in the future
where you need things that are not in the core language. You can put them
in the same library. I don't think anyone will (or should) blame you for
doing this.

As for beginners encountering this def- issue, maybe it is a good
opportunity to talk to them about Lisp being a programmable programming
language. That's one of the big advantages of Lisp. It would be unfortunate
to restrict ourselves to a way of thinking inherited from inferior
languages.

It shouldn't be a lot of work. A quick copy-and-paste from `defn-` gave me
this:

(defmacro def-
  "same as def, yielding non-public def"
  [name & decls]
    (list* `def (with-meta name (assoc (meta name) :private true)) decls))

On Wed, Feb 28, 2018 at 1:58 PM, Leon Grapenthin <grapenthinl...@gmail.com>
wrote:

> The one issue with the lack of def- is the existence of defn-. If defn-
> didn't exist, no one would ask for def-. I believe this is where the
> "regret" comes from.
> The other issue with the lack of def- is that its annoying to type
> ^:prviate. I don't see how you could accidentally mistype it (never
> happened IME) or the need for compiler aid.
> If beginners think that there is a magic postfix syntax, I don't see how
> this is a problem. They are beginners and naturally there will be many
> things that fail their intuition.
> Compiler auto injection on postfix magic I'm strongly opposed to.
>
> @Alex thanks for your long reply yesterday and the statistics! I'll get
> back to that.
>
>
> On Wednesday, February 28, 2018 at 8:06:51 PM UTC+1, Didier wrote:
>>
>> I think the issue is not with the lack of def-, but with the use of
>> metadata for private, as well as the presence of defn-.
>>
>> Becauae defn- exists, most newcomers think that postfix - on var defining
>> special forms, macros and fns is how you mark things as private.
>>
>> But its not, defn- is a syntactic hack.
>>
>> The compiler and runtime looks for the private metadata on the Var for
>> that. But metadata is easy to typo and always confusing as to where it
>> needs to be inserted.
>>
>> Not sure there's a solution. Maybe reserved meta could be turned into a
>> different syntax of reserved keywords which the compiler could validate if
>> its misplaced or mistyped? Or postfix - on any first symbol in a form could
>> be special syntax where the compiler auto-injects the private meta on the
>> returned Var.
>>
>> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to