[Python-ideas] Fwd: Make parenthesis optional in parameterless functions definitions
Steven D'Aprano
steve at pearwood.info
Fri Apr 1 07:05:53 EDT 2016
On Fri, Apr 01, 2016 at 11:32:00AM +0200, Sven R. Kunze wrote:
> >However, Hypertalk, and other similar "XTalk" languages, do. Function
> >calls in Hypertalk generally have a long form and a short form. The long
> >form will be something like:
> >
> > total = the sum of field "expenses"
> >
> >while the short form is the more familiar:
> >
> > total = sum(field "expenses")
> >
> >
> >Although Hypercard only allowed the long form if there was exactly one
> >argument.
[...]
> >In Hypertalk, it worked very well. But I wouldn't think it would be a
> >good fit to Python.
>
> Interesting. I think I will have a look at Hypertalk. :)
Unfortunately, Hypertalk is long dead. Apple never quite understood why
it was popular, or what to do with it. But it influenced the design of
the WWW and Javascript, and it lives on in a couple of languages such as
OpenXion and LiveCode:
https://github.com/kreativekorp/openxion
https://livecode.com/download/
(LiveCode has a booming user community, OpenXion is all but dead, but it
works and lets you experiment with the language.)
If you have an old Classic Mac capable of running System 6 through 9
(pre OS X), or an emulator for the same, then you might be able to run
Hypercard, which was a sort of combined software development kit,
Rolodex application, and IDE. Hypercard was the GUI to the Hypertalk
language, and Hypertalk was the scripting language that controlled the
Hypercard GUI.
https://en.wikipedia.org/wiki/HyperCard
> Why do you think it would not fit into Python?
Hypertalk's execution model, data model and syntax are all very
different from Python's. Hypertalk was also linked very heavily to the
GUI, which makes it a relatively weak fit with less specialised
languages like Python.
But mostly, Python already has a standard syntax for calling functions:
value = function(arg)
There's no need to add a more verbose "the function of arg" syntax.
--
Steve
More information about the Python-ideas
mailing list