I find these to be very convenient, particularly since I use the base-10 log fairly frequently:
Log[2, n]=>Log2@nLog[10, n]=>Log10@n
These represent a very specific type of syntactic sugar, in which the parameter modifying the function (in this case, the base) is subsumed into the function name.
Thus I'm wondering: Are there any other constructions like these?
These are qualitatively different from the main class of Mathematica keystroke-savers, namely the extensive set of operator short forms, such as /@ for Map (see Mathematica Operator Input Forms). Indeed, Wolfram itself seems not to consider Log2 and Log10 special Operator Input Forms, since they can't be found in the latter list.
Again, I'm specifically refering to constructions in which a parameter is subsumed into a function name. In case this is still a bit unclear, just for the purpose of illustration, consider Drop, and imagine that Rest didn't exist. It's common to use Drop to remove the first element of an expression, using the parameter 1, as in Drop[expr, 1]. Thus a nice bit of syntactic sugar (if Rest didn't exist) would be if there were, say, Drop1 to do this. I.e., Drop1@expr instead of Drop[expr, 1].
Another hypothetical example would be if there existed, say, FormatT and FormatS as short forms for Format[expr, TraditionalForm] and Format[expr, StandardForm].
Note that, by contrast, LegendreP and LegendreQ don't count, because each of these is a distinct function in its own right. I.e., there is no Legendre function, for which P and Q are possible parameters.
|->, you can see a complete list in What the @#%^&*?! do all those funny signs mean? – Ben Izd Jun 16 '21 at 04:20OperatorAppliedcan be used to create operator forms. – LouisB Jun 16 '21 at 05:30|->in the documentation. Could you please kindly shortly explain, what is it and give a reference? – Alexei Boulbitch Jun 16 '21 at 09:50//=), it's just an easy way to type\[Function]. Syntax was mentioned in Function but as of now, I couldn't see an example in the examples section. You can see examples in the 12.2 announcement blog under the "Making Code Just a Bit More Beautiful" section. – Ben Izd Jun 16 '21 at 10:44Logthat match your criteria? It seems that there may not be others like that, and that those only satisfy your criteria by chance/on a technicality. – CA Trevillian Jul 05 '21 at 22:22StringTake[Hash["1234", "Expression", "Base64Encoding"], ;; -2]withGeneralUtilities`Base64Hash["1234"]– flinty Jul 05 '21 at 22:33Log[b, x]is short forLog[x]/Log[b](and this shows thatLog2andLog10are really short for such forms and thatLog[x]/Log[2]really has two short forms). But at this point, if it’s merely about some code transforming into other code, I think the boundaries of what can and cannot be included will disappear. – Michael E2 Jul 06 '21 at 00:02Log[10,x], and always thought it was cumbersome (plus I always had to test it or look it up, since I could never remember if it wasLog[x, 10]orLog[10,x]). Thus I was chagrined to discover that there was a simple, easily-remembered shortcut I could have been using all along:Log10. Consequently, I am wondering if are others like this of which I'm unaware. – theorist Jul 06 '21 at 01:32Log[b, x]is short forLog[x]/Log[b](and this shows thatLog2andLog10are really short for such forms...." Agreed. ".... and thatLog[x]/Log[2]really has two short forms". Not following—it seemsLog[x]/Log[2]has one short form:Log2. Also: I think there's a clear distinction between the class of functions I'm asking about, and the usual operator short forms, as indicated by the fact that Wolfram didn't includeLog2andLog10on their Operator Input Form List (https://reference.wolfram.com/language/tutorial/OperatorInputForms.html) – theorist Jul 06 '21 at 01:40Log[2, x]andLog2[x]are short forLog[x]/Log[2]. Note that this is not true for numericx:x = 1.4; Log2[x x] - Log[2, x]andLog2[xx] - Log[xx]/Log[2]. Try it forx = 0.9andx = 0.499and see that all three are different. -- Also, I'm not talking about operator forms, but code (e.g.Log2[x]) that expands to other code (Log[x]/Log[2]). The first is a way to get the second, and if it's shorter, we can call it a "short form." – Michael E2 Jul 06 '21 at 04:05Hypergeometric2F1[a, b, c, z]being short forHypergeometricPFQ[{a, b}, {c}, z]? (There are a few other hypergeometric examples.) – Michael E2 Jul 06 '21 at 04:12Expand. But—and forgive me if I'm missing something—that doesn't seem to have anything to do with what I mean by short form, so I'm afraid I don't see the relevance here. Again, I'm talking specifically about functions (esp. commonly-used function) that take some value as a modifier to what the function does (Wolfram calls it a "value", but that word has an overly broad meaning, so let's call it a "parameter").... – theorist Jul 06 '21 at 05:22Drop, and imagine thatRestdidn't exist. It's common to useDropto remove the first element of an expression, using the parameter1, asDrop[expr, 1]. Thus a nice bit of syntatic sugar (ifRestdidn't exist) would be if there were, say,Drop1to do this. I.e.,Drop1@expr instead ofDrop[expr, 1]` . That's the kind of construction I'm talking about. – theorist Jul 06 '21 at 05:29Hypergeometric2F1[a, b, c, z]is a nice convenience vs.HypergeometricPFQ[{a, b}, {c}, z], though this is a different class of convenience from what I'm referring to. Here, instead of subsuming a parameter into the function name, the syntactic convenience is that you can drop a bunch of curly braces. Also: I'm afraid I didn't follow what you were trying to say with your numerical example. Is x x =x^2, and is xx a new variable? [N.B.: I just rewrote my OP, incorporating language I used in my comments to you; hopefully that will make it clearer.] – theorist Jul 06 '21 at 07:13ListLinePlotvs.ListPlotcount? Apart from potentially minor differences I am not aware of, the main one is thatListLinePlotis effectivelyListPlotwith the optionJoined->True– Lukas Lang Jul 06 '21 at 07:23ListLinePlotgives more distinctive (larger) points thanListPlotw/Joined->True. Compare, for instanceListPlot[Table[Sin[x], {x, 0, 2 Pi, 0.1}], Mesh -> All, Joined -> True]withListLinePlot[Table[Sin[x], {x, 0, 2 Pi, 0.1}], Mesh -> All]]. – theorist Jul 06 '21 at 08:05xxreadx. That was a typo I didn't catch. -- So, for things likeFuncA[x]being short forFunc[A, x]orFunc[x, A], there are no others I believe. For things likeListLinePlot, perhapsNDSolveValue[ode, {y1, y2,...}, ...]as short for{y1, y2,...} /. First@NSolve[ode, {y1, y2,...},...](ignoring some trivial checking for more than one solution) would likewise count? – Michael E2 Jul 06 '21 at 13:58Log2is that it is an implementation of an IEEE 754 recommendation. Others includeInternal`Log1pandInternal`Expm1. Or they could be looked as exposing some of the MKL functions. This includesInternal`ReciprocalSqrtandInternal`Square. But notInternal`AbsSquare, which is in neither IEEE 754 nor MKL. Again they are not merely short forms, but separate implementations that reduce round-off error and/or improve speed. – Michael E2 Jul 11 '21 at 16:42