7 ms·
Proposal: Downward Assignments
- gkop 6y agoPartisans in favor of spaces over tabs, here’s another argument for your arsenal.
- smitty1e 6y agoTabs are evil => https://www.emacswiki.org/emacs/TabsAreEvil https://www.emacswiki.org/emacs/TabsAreEvil
- 8note 6y agoI see something different in there. F(condition1, Condition2) Is worse than F( Condition1, Condition2 ) The problem isn't tabs or spaces, it's trying to align to the length of the function name instead of adding a new line
- deleted 6y ago[deleted]
- deleted 6y ago[deleted]
- twic 6y agoI thought this might be some inverse of upvar from Tcl (which is not an April Fool): https://www.tcl.tk/man/tcl/TclCmd/upvar.htm https://www.tcl.tk/man/tcl/TclCmd/upvar.htm
- multiplegeorges 6y agoA truly inspired proposal!
- MarkLowenstein 6y agoFantastic. Not on-board with the ^^^^ syntax - could be improved. But it reminds me of how sequential-character syntax is limiting, like if you were going to make an integrated circuit in strict 2 dimensions, without being able to bridge over traces sometimes in a minimally 3-dimensional way. This is like bringing programming into, literally, a new dimension.
- anthony_romeo 6y agoPerhaps they could make use of all of those box-drawing characters that are just taking up space, and use them to pipe the characters in all sorts of directions! https://en.wikipedia.org/wiki/Box-drawing_character https://en.wikipedia.org/wiki/Box-drawing_character
- lifthrasiir 6y agoEh, like Funciton? https://esolangs.org/wiki/Funciton https://esolangs.org/wiki/Funciton
- viklove 6y agoCan't this just be solved by using a do/while loop?
- oivaksef 6y agoThis is hilarious, and clearly a joke, but it does make one think. I've always thought that it would be nice to have variables which you don't name, which only live over a couple of lines, where it's clear the variable is just for some plumbing and doesn't need a name. I wonder if there is actually something in these two concepts combined
- 8note 6y agoHow do you reference a variable for plumbing if it doesn't have a name?
- inivekin 6y agoWouldn't any concatenate language fit the bill? https://concatenative.org/ https://concatenative.org/
- thepratt 6y agoWould Elixir's pipe - https://elixir-lang.org/getting-started/enumerables-and-streams.html#the-pipe-operator https://elixir-lang.org/getting-started/enumerables-and-stre... - or Haskell's function composition - https://wiki.haskell.org/Function_composition https://wiki.haskell.org/Function_composition - fit the criteria?
- oivaksef 6y agoThose would. The Elixir style feels nice. I wonder if something like that could make it into Ruby 4
- acidbaseextract 6y agoMentioned in another sub-comment, but Clojure's threading macros do this. They do it by making positional assumptions about the implicit argument: https://clojure.org/guides/threading_macros https://clojure.org/guides/threading_macros
- nonameiguess 6y agotidyverse packages in R do this. Normally, you might have something like this: df = someFunctionThatReturnsADataFrame() newDf = someFunctionThatTakesAndReturnsADataFrame(df) doSomethingTo(df) Since R lets you define your own operators, they took '%>%' and defined it as "pipe the return value from one function as the first argument to another function," so you can do this: someFunctionThatReturnsADataFrame() %>% someFunctionThatTakesAndReturnsADataFrame() %>% doSomethingTo() No need to name either the temporaries or the function arguments.
- bcardarella 6y agoThe number of people that don't have their guard up on April 1 is always astounding.
- aflag 6y agoI can only imagine what the elegance and clarity when we start writing code in 3D.
- kmstout 6y agoI know this is a joke, but it really might be worth an experimental implementation, just to see where this leads. (Decent editor support would be critical.)
- lifthrasiir 6y agoThat kinda reminds me of Perl format [1]. It is not exactly whitespace dependent, though. [1] https://perldoc.perl.org/perlform https://perldoc.perl.org/perlform