21
$\begingroup$

As outlined here, := may be used in scoping constructs like With to give delayed definitions, but this is undocumented.

This has been in the language since at least Mathematica 4.0. It is very useful and it does not appear to be "dangerous" that I can see. I cannot think of any good reason for this to have remained undocumented for so long.

Is there an argument to be made for hiding this important functionality?

$\endgroup$
6
  • 3
    $\begingroup$ Have you asked WRI Support? :) $\endgroup$
    – Kuba
    Aug 3, 2016 at 11:47
  • 1
    $\begingroup$ @Kuba No. I like exploring things here more. Perhaps someone will give a reason I never even considered (this happens more often than I'd like!) and if not its visibility likely provides a greater impetus to WRI to document it than a simple suggestion from a random non-premium user. $\endgroup$
    – Mr.Wizard
    Aug 3, 2016 at 11:55
  • 2
    $\begingroup$ @Kuba p.s. (119915) Have you asked WRI Support? ;-) I still haven't come up with a good answer to that question but I intend to give it more thought. $\endgroup$
    – Mr.Wizard
    Aug 3, 2016 at 12:11
  • 1
    $\begingroup$ Doesn't this question fit perfectly the clause "The question is out of scope for this site. The answer to this question requires either advice from Wolfram support or the services of a professional consultant."? Perhaps, if Leonid drops in and he is considered to be a professional consultant.... $\endgroup$ Aug 4, 2016 at 8:56
  • $\begingroup$ @IstvánZachar You are welcome to vote to close. If the community wishes to close this question I will not treat myself as special and reopen it. I genuinely wonder if there is some reason, and in similar cases people have pointed out something I completely missed, or otherwise the question lead to important information. I am glad these were not closed: (58963), (59979), (89093) $\endgroup$
    – Mr.Wizard
    Aug 4, 2016 at 12:33

1 Answer 1

9
$\begingroup$

This now seems to be documented officially, see the Details section on With, since version 13.2. There was no obvious update to core functionality that might explain why it was added at that version change. So I guess it was either an oversight with very low priority, or something internal that we will never learn.

With[{x:=x0, …}, expr] inserts the unevaluated form x0 into expr.

Good that it's there after (at least) 23 years, v4 in 1999.

$\endgroup$
2
  • 4
    $\begingroup$ better late than never :). But still Mathematica documentation are the best of anything else I've seen. $\endgroup$
    – Nasser
    Dec 16, 2023 at 17:48
  • 1
    $\begingroup$ @Nasser Agreed. And it explains the very gentle learning curve, compared to many other languages. $\endgroup$ Dec 16, 2023 at 17:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.