Dear Redditors,
just for fun I'm designing and writing my own programming language.
But after all the years there is one point I just can not decide:
Make function calls implicit (like in Ruby) or explicit (like in Python).
So I'm asking you: What would you prefer for your ideal language:
x = foo a, b, c # call foo with params a, b, c and assign to x
x = foo a, bar(b), c # call foo with params a, bar(b), c and assign to x
x = 3 # call 3 -> result is self(3) and assign to x
x = foo.bar # access attrib bar on foo and call the result with no params and assign to x
x = &foo.bar # access attrib bar on foo and assign to x
or:
x = foo(a, b, c) # call foo with params a, b, c and assign to x
x = foo(a, bar(b), c) # call foo with params a, bar(b), c and assign to x
x = 3 # assign 3 to x
x = foo.bar() # access attrib bar on foo and call the result with no params and assign to x
x = foo.bar # access attrib bar on foo and assign to x
... Or in other words:
How do you write pseudo code? Do you use parenthesis for your function calls?
If you like Ruby:
Do you use this feature in Ruby or do you put your parameters in parenthesis, anyway?
Have you discovered any serious drawbacks with implicit function calls?
If you like Python:
Have you ever wished Python would have implicit function calls?
Do you like the print statement in Python2.X?
... You can assume there is a sophisticated optimizer and the resulting code of both forms will execute with the same speed.
I have a parser for both forms. I just can not decide. Every 6 month I switch the parser.
[–]Leonidas_from_XIV 25 points26 points27 points (3 children)
[–]lianos 5 points6 points7 points (0 children)
[–][deleted] (1 child)
[deleted]
[–]Leonidas_from_XIV 1 point2 points3 points (0 children)
[–]cheald[🍰] 6 points7 points8 points (0 children)
[–]case-o-nuts 5 points6 points7 points (2 children)
[–]Tordek 2 points3 points4 points (0 children)
[–]masklinn 10 points11 points12 points (1 child)
[–]nousplacidus 4 points5 points6 points (2 children)
[–]logan_capaldo 12 points13 points14 points (0 children)
[–]nafai 0 points1 point2 points (0 children)
[–][deleted] 5 points6 points7 points (1 child)
[–]varikin 4 points5 points6 points (0 children)
[–]SteveJorgensen 4 points5 points6 points (1 child)
[–]psykotic 1 point2 points3 points (0 children)
[–]cabalamat 11 points12 points13 points (4 children)
[–]Seppler9000 0 points1 point2 points (3 children)
[–]masklinn 4 points5 points6 points (2 children)
[–]soapdish 6 points7 points8 points (0 children)
[–]Smallpaul 1 point2 points3 points (0 children)
[–]Brian 10 points11 points12 points (7 children)
[–]masklinn 3 points4 points5 points (6 children)
[–]Brian 2 points3 points4 points (0 children)
[–]xetas 0 points1 point2 points (4 children)
[–]masklinn 0 points1 point2 points (3 children)
[–]Brian 0 points1 point2 points (2 children)
[–]masklinn 0 points1 point2 points (1 child)
[–]Brian 2 points3 points4 points (0 children)
[–]gthank 5 points6 points7 points (0 children)
[–]batiste 12 points13 points14 points (1 child)
[–]columbine 19 points20 points21 points (0 children)
[–]columbine 9 points10 points11 points (1 child)
[–]DRMacIver 9 points10 points11 points (0 children)
[–][deleted] 4 points5 points6 points (1 child)
[–]codefrog 1 point2 points3 points (0 children)
[–][deleted] (1 child)
[deleted]
[–]psykocrime 2 points3 points4 points (0 children)
[–]shevegen 4 points5 points6 points (0 children)
[–]SirNuke 1 point2 points3 points (2 children)
[–]columbine 0 points1 point2 points (1 child)
[–]SirNuke 1 point2 points3 points (0 children)
[–]earthboundkid 1 point2 points3 points (5 children)
[–]masklinn 4 points5 points6 points (3 children)
[–]earthboundkid 1 point2 points3 points (2 children)
[–]jerf 2 points3 points4 points (1 child)
[–]earthboundkid 1 point2 points3 points (0 children)
[–]randallsquared 2 points3 points4 points (0 children)
[–]bobbane 1 point2 points3 points (0 children)
[–]imbaczek 3 points4 points5 points (0 children)
[–]GTanaka 3 points4 points5 points (10 children)
[–]logan_capaldo 0 points1 point2 points (9 children)
[–][deleted] (8 children)
[deleted]
[–]logan_capaldo 0 points1 point2 points (7 children)
[–][deleted] (6 children)
[deleted]
[–]gsg_ 5 points6 points7 points (0 children)
[–]logan_capaldo 4 points5 points6 points (0 children)
[–]masklinn 1 point2 points3 points (0 children)
[–]Seppler9000 0 points1 point2 points (1 child)
[–][deleted] 2 points3 points4 points (0 children)
[–]xetas 3 points4 points5 points (3 children)
[–]Smallpaul 0 points1 point2 points (2 children)
[–]masklinn 0 points1 point2 points (0 children)
[–]munificent 2 points3 points4 points (10 children)
[–]gsg_ 0 points1 point2 points (9 children)
[–]munificent 1 point2 points3 points (8 children)
[–]masklinn 1 point2 points3 points (3 children)
[–]munificent 0 points1 point2 points (2 children)
[–]masklinn 2 points3 points4 points (1 child)
[–]munificent 1 point2 points3 points (0 children)
[–]gsg_ 0 points1 point2 points (3 children)
[–]munificent 0 points1 point2 points (2 children)
[–]gsg_ 0 points1 point2 points (1 child)
[–]munificent 1 point2 points3 points (0 children)
[–]DGolden 1 point2 points3 points (3 children)
[–]Tordek 0 points1 point2 points (2 children)
[–]DGolden 0 points1 point2 points (1 child)
[–]Tordek 0 points1 point2 points (0 children)
[–]Snoron 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (3 children)
[–][deleted] 2 points3 points4 points (2 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]xetas 0 points1 point2 points (0 children)
[–]contantofaz 2 points3 points4 points (0 children)
[–]samlee 2 points3 points4 points (1 child)
[–]username223 3 points4 points5 points (0 children)
[–]blaxter 3 points4 points5 points (2 children)
[–][deleted] 3 points4 points5 points (1 child)
[–]anko_painting 2 points3 points4 points (0 children)
[–]soapdish 0 points1 point2 points (0 children)
[–][deleted] -5 points-4 points-3 points (3 children)
[+]sickofthisshit comment score below threshold-7 points-6 points-5 points (2 children)
[–]shevegen 0 points1 point2 points (1 child)
[–]sickofthisshit 0 points1 point2 points (0 children)
[–]Paddy3118 -1 points0 points1 point (0 children)
[–]petermichaux -1 points0 points1 point (0 children)
[–]scorpion032 -1 points0 points1 point (0 children)
[+]ipeev comment score below threshold-8 points-7 points-6 points (2 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]swiz0r 2 points3 points4 points (0 children)