« first day (3782 days earlier)      last day (1065 days later) » 

2:01 PM
hm. i'm considering making my own language (like actually this time - i scrapped yuno because it was too annoying), and I'm probably going to use same/similar tacit structure to jelly. should I add a 2,2,2 rule above the topmost Jelly dyadic rule to do the special case always?
 
@cairdcoinheringaahing Essentially, you want APL's trains (=chains)
 
hi all
 
@Adám Jelly's chains seem a lot more general than APL's trains (especially since it doesn't seem to have "normal" dyadic function application)
 
bpa.st/WT5A is my attempt to make a benchmark for sorting 1 million ints
 
:O I found a 5-byte HQ9+ quine
 
2:04 PM
you have to type 1000000 when you run it
can anyone make it faster?
 
@cairdcoinheringaahing oh
I am somewhat understanding Jelly
 
IMO Jelly chains are golfier and APL trains are more intuitive. But I'm not a good judge of this because I know pretty little about APL and I am decent at golfing in Jelly but not APL, and I already intutively get (most of) Jelly chains
 
@user What do you mean by "normal" dyadic function application?
 
I understand APL more than Jelly
 
@Adám Like (some expression that isn't a constant and requires parentheses) <dyadic function> (another expression)
You can't directly do that in Jelly, but that opens up the syntax for more chaining rules
 
2:07 PM
@user Oh, "it" goes on Jelly.
 
Actually, looks like you can, I'm an idiot
@Adám Pronouns are annoying
 
Don't go there!
 
so you can't do (+)*(+)? AFAICT, that gives (a + b)^2
or a^2 + b^2
 
@StackMeter in jelly?
or APL
 
@StackMeter Pretty sure you can do that in both Jelly and APL (without parentheses (APL doesn't require parentheses, and I don't think they mean the same thing in Jelly))
 
2:09 PM
@hyper-neutrino Jelly
 
first of all * is exponentiation lol
 
^ × for multiplication in APL
 
at the beginning of a dyadic chain, +×+ will become the special 2,2,2-chain (which is really just a special-case dyadic start and then a regular 2,2-chain), which does λ = (α + ω) × (α + ω)
otherwise, depends on what's before it. assuming the code before it is already completed, this is a 2,2-chain and then a lone dyad, which then depends on what's after it
 
So far the same in APL and Jelly.
 
APL is RTL right?
 
2:11 PM
Yes.
 
cool
assuming the code before it won't chain with this dyad and there is either no code after this or it starts with a monad
 
I don't understand why Jelly would take +,_2+ as (+,)(_2+) then.
Why isn't it become (+,_)2+ ?
Though I don't understand what 2 does there.
 
+×+ is a 2,2-chain into a lone dyad. the first does λ = λ + (α × ω) and the second does λ = λ + ω, so overall the new value is (λ + (α × ω)) + ω
@Adám 2,2,2 is a special case only at the beginning of a dyadic chain
so at the beginning, it is (+,_)(2+)
otherwise, it is (+,)(_2)(+)
 
Oh. Yikes.
 
@hyper-neutrino Does that help with golfing?
 
2:14 PM
APL's trains are definitely more regular then.
 
it's... a bit strange. but there is likely a reason behind this, probably just golfiness. i trust dennis made these decisions consciously and had a good reason for each design choice
 
How long did it take him to design Jelly?
 
Yeah, because J is identical to APL in the respect.
 
@user i can't recall the last time I used it, so idk
 
Looks like it was under heavy development for ~2 years
 
2:16 PM
@user 4 Dec 2015–17 Jan 2019 according to GH.
 
the core of it probably took about 2 years, and new built-ins and features were continually added until the last commit, probably
 
@Adám Is there a way to find that without going through all the commits page by page?
 
@user I did it manually, but you might be able to find it in api.github.com/repos/DennisMitchell/jellylanguage/commits
 
@Adám One example would be +1+,_2+ vs +,_2+. The first is parsed as (+1)(+,)(_2)(+), whereas the second is (+,_)(2+). You can force the first to be (+1)(+,_)(2+) with an extra byte: +1+,_ɗ2+
I believe that this is generally golfier - before the introduction of ɗ it would've had to be +1ð+,_ð2+, and ð...ð is not a common occurrence in Jelly answers
 
0
A: Sandbox for Proposed Challenges

AnushHow much faster than qsort can you achieve? Task Sort 1 million 32 bit integers as quickly as possible. Score I will run your code and compare the timings to my default C code using qsort. That is: #include <stdio.h> #include <stdlib.h> #include <time.h> #include <stdint.h> int cmpfunc (const v...

 
2:34 PM
asked the necessary question of "Are builtins banned?"
 
@cairdcoinheringaahing Wait no, that's not equivalent :/
 
@cairdcoinheringaahing so would you say it's a good idea to implement 2,2,2 everywhere or is dennis's choice better?
i don't use either often enough to really know what to think. i tend to use +A} as a 2,2 a lot more than a proper 2,2
 
@hyper-neutrino Personally, I prefer 2,2,2 everywhere as its more consistent, but I can't speak to the golfiness
@hyper-neutrino The fun one is +A}, being parsed as a 2,2,2 at the start :/
 
@hyper-neutrino consistency is everything
 
I posted my qsort sandbox question. I hope it turns out to be fun!
 
2:37 PM
@cairdcoinheringaahing oh yeah :/ rip
tbh might make a built-in in my language that just converts a dyad-monad into a x + F(y) combo just to make it a bit more understandable
if i can afford the byte
 
Yeah, if there was a builtin like $ which forced that parsing, that'd be cool
 
thanks @cairdcoinheringaahing
 
@Anush Thank you for giving me the chance to yet again object to builtin bans :P
 
@cairdcoinheringaahing and to change my opinion :)
now.. which language will have a much faster builtin sort??
 
this is just "fastest sort", i don't think the comparison to another algorithm really makes a difference?
 
2:40 PM
@hyper-neutrino what do you mean to another algorithm?
 
does comparing the timing to your qsort actually make a difference to scoring?
i'm not suggesting you edit it out - just wondering
 
@hyper-neutrino It provides a "baseline" contender: "beat this or don't post"
 
@hyper-neutrino no it just makes it more fun
 
@cairdcoinheringaahing ah, good point
 
@cairdcoinheringaahing and that too
 
2:41 PM
so no bogosort :P
 
Damn, there goes my plans :/
 
I think it's called ego stroking :) People like to be faster than builtins I think
 
i'm surprised we don't have a challenge that's just " sort a list" ¯\_(ツ)_/¯
 
@hyper-neutrino it really matters what's in the list
amazingly, it's still not obvious what is the fastest sorting algorithm and when
 
2:43 PM
TBH i feel like sort in Python is going to be... pretty competitive
unless the list is not very well generated, timsort is pretty good afaict and it'll take a lot of knowledge of theory to be able to make something that will beat it in python
 
@hyper-neutrino timsort is very good if the array is almost sorted already. But in my task it isn't
 
@Anush Have you tried benchmarks with builtins in languages (e.g. Python's sorted)?
 
@cairdcoinheringaahing no just C's qsort but I am fairly sure timsort will be worse
 
I think you should probably try sorted and maybe the builtin sorts for Java or other mainstream languages and see how they compare. If it's very close, the challenge may not be that interesting
 
maybe I should add some motivation? qsort is slower than it should be because the comparison function can't be inlined
timsort will be slow because the array is not close to being sorted
because it is 32 bit ints it is likely some variant of radix sort will be fast
and quadsort does well in benchmarks
it shouldn't be a competition just between builtins
my guess is that something that takes advantage of the small size of the ints will win
 
2:49 PM
@Anush I agree. My concern is that might happen, depending on how good the builtins are. Therefore, I recommend you get some idea of how good they are before posting the challenge
 
@cairdcoinheringaahing could you help me do that ?
I only know C and python
 
ngn
@Anush yes, 1000000<256^3, so radixsort should take only 3 passes processing one byte each
 
@Anush That's one more (practical) language than I know, unfortunately
I'd suggest messing around on TIO's bash to create a basic script that generates a list of numbers and times each submission. The script here would be a good starting point
 
@ngn yes. I think that's a very good idea
@cairdcoinheringaahing I added the C and python timings
@ngn there is inplace radix sort which I guess would be even faster
 
does anyone here know how TIO works?
 
3:05 PM
I have some understanding of it, why?
 
@AncientSwordRage In what way?
 
@ngn I guess even 32 bit ints only need 4 passes. Maybe I should increase the size to 32 bits
 
My company is now blocking it from running as it downloads a file....wondering if that's a recent change
 
TIO hasn't changed in over 18 months
 
ah so it's my company
@cairdcoinheringaahing I did hear something about Denis...
 
3:06 PM
in talk.tryitonline.net, Feb 3 '20 at 16:39, by Dennis
Hey all. I'm sorry for disappearing on you and for taking bad care of TIO lately. I'll try to explain what's been happening, although it's not easy for me to talk about this...
 
is there any way for you to see the name of the file being blocked?
 
We have had a few minor bugs (e.g. Mathematica's certificate expiring, code refusing to run etc.) that seem to have been fixed after we reported it, and Dennis appears to be "checking" talk.tryitonline (e.g. he was last seen 20 seconds ago), which suggests that he might be handling the absolute essentials to keep TIO going. Beyond that tho, nothing's changed
 
@hyper-neutrino yes, I think it's a string of numbers
 
I've dropped a link to your message in talk.tryitonline, in case its something that does need to be checked out
 
hm. strange. can you permalink what exactly you're trying to run? i doubt i can actually figure out the issue but i can give it a look
 
3:13 PM
I've dropped details in the talk.tio chat
 
thanks!
 
@cairdcoinheringaahing A loved one has gone through something extremely similar: Fibro -> Depression -> Anxiety -> Spiral
(also whats minigolf in the context of this chat room?)
 
@AncientSwordRage TNB or talk.TIO?
 
@AncientSwordRage Ah, sorry to hear about that :(
 
7
Q: Introducing Biweekly Mini Golf!

Redwolf ProgramsIn order to grow our community and its chat room, The Nineteenth Byte, we decided here to start a new monthly biweekly chat event: Biweekly Mini Golf! During this event, a number of previously drafted "CMCs" (short for Chat Mini Challenge) will be posted, and anyone can reply with their solutions...

 
3:15 PM
@AncientSwordRage if you're talking about Biweekly Mini Golf, it's an event where we basically just dump a crap ton of CMCs (chat mini challenges). so an organized event where we just solve a bunch of comparatively easy challenges
or read ^^ lol
 
I'm down for that
 
@Adám Thanks, that's helpful
 
it's just a casual golfing event where we can post simpler challenges and more notably, unlike on main site, CMCs don't need to be that well specified, as long as there's a pretty reasonable interpretation to agree on
 
@AncientSwordRage I can;t speak from experience, but from Dennis said in his messages, it sounds like an extremely tough thing to deal with, and I for one am 100% supportive of Dennis taking as much time as he needs to get better
 
@cairdcoinheringaahing same here
 
3:19 PM
things like the mathematica license being fixed and critical issues being fixed indicate that dennis is at least well enough to keep TIO in a functional state which makes me glad to see - of course I hope he eventually feels well enough to return to updating TIO or even return to CGCC itself but as long as he's alright i'm happy
 
pxeger and Bubbler are working on their own TIO clones, which'll take pressure off of Dennis
 
@hyper-neutrino exactly
 
@ngn do you think 3 passes would be slower than 1? 2^20 is not very big
 
ngn
@Anush i think 3>1, yes :)
 
@ngn :) I meant in terms of practical performance because of caches etc
I assume you chose 3 passes for a reason
count sort has poor data locality
 
ngn
3:32 PM
@Anush i said "3 passes" because you limited your numbers to 10^6, and thats between 256^2 and 256^3
 
@ngn yes. But can we instead do a pass using 20 bits instead?
 
ngn
@Anush you don't know until you test :)
 
@ngn all true :)
I will leave the question over night but I think I might increase it to 32 bits. 10^6 is a bit small
or maybe 31 bits because of RAND_MAX
CMC find the minimum of (32/r) *(10^6 + 2^r) for r > 1
 
@Anush Approx 2118361.135
 
ah, i'm too lazy to do calculus right now. i trust caird's right.
 
3:44 PM
I trust caird's ability to use a calculator lmao
 
I just stuck log ((32/r) *(10^6 + 2^r)) into desmos, it shows the min point :P
 
I was hoping for code :)
 
Desmos is a valid language here :P
 
@cairdcoinheringaahing oh smart. i put the original in and couldn't find the line
 
It's at 10^6 + a bunch :P
 
3:46 PM
 
how does this wo- oh wait, you hard-coded the number, didn't you ಠ_ಠ
 
oh.. no hardcoding please!
I want the code to solve the problem!
 
@Anush Python: print(2118361.135): Try It Online!
 
@pxeger noooo :)
 
3:48 PM
Kappa
 
@Wezl I think you should add DJ's last comment to your question - it makes the task a lot clearer
 
@Anush It involves either differentiation, which most languages won't do, or manually finding it, which is kinda boring. But, I'm already bored, so I'll write a Jelly finder :P
 
@cairdcoinheringaahing surely a binary search would do it
 
@user I agree, but I'm not sure how to fit it in. I'll find out
 
@Anush assuming it's differentiable and continuous
 
3:50 PM
It is and is (aside from x = 0, obviously)
 
@cairdcoinheringaahing yes and yes
I said r > 1
 
(well yes, and you'd struggle to find the minimum anyway if it wasn't)
 
true
it also has a unique minimum
 
moreover it has just one critical point so it shouldn't be hard
i'm just too bored to do it right now
 
code should not be hard to do this
@hyper-neutrino you could solve my sorting problem instead :)
 
3:52 PM
My favourite sorting method is sleep sort
6
 
...sleep repeatedly until enough cosmic rays have hit the computer that the array became sorted?
 
@cairdcoinheringaahing what is it doing?
 
@pxeger e.g. sort the number 1, 32, 6, 864000, you just sleep for that number of (milli)seconds, and out put the number each time
 
ah I see
 
3:55 PM
after 1 unit of time, output 1. After 6 milliseconds you output 6 etc...
 
@user thanks, I think I'll post now
 
@Anush It generates the range from 1.001 to 20 in intervals of 0.001, runs the helper link over each (which is defined as (32/r) *(10^6 + 2^r)), then calculates the minimum
 
@hyper-neutrino Can you 11 the pinned message about BMG to say 24 hours away instead?
The edit 11 not the delete one :p
 
@cairdcoinheringaahing cool. I still think binary search would be better
 
Thanks!
 
3:56 PM
@Anush Probably, but binary search is Jelly won't be as nice
 
:( jelly needs upgrading then
 
you can keep narrowing down a range so your result gets more and more precise as you keep running it
but like
that sounds annoying
 
@Anush If you're using Jelly for production code, you're an idiot :P
4
Yes, that includes me :p
Here's a version which takes an upper bound x on the left and a precision value p on the right (as is, calculates the range to p decimal places with a step of 10^-p )
 
@cairdcoinheringaahing :)
 
@Wezl lol, SE says my last "I'm Lazy" question is a "similar question"
 
4:00 PM
0
Q: I'm Lazy: Close my Superparens

WzlPicolisp has a feature called "super parentheses": Brackets ('[' and ']') can be used as super parentheses. A closing bracket will match the innermost opening bracket, or all currently open parentheses. src Taking a string containing only the characters []() (and newline if your language requir...

 
@NewPosts One of those tags is Jelly friendly, the other 4 are the worst tags for Jelly answers :P
 
great, because I always get a jelly answer first :P
 
lol, syntax highlighting doesn't like elif"..."
it turns the f"..." into an fstring
 
I'd really love to know why it's apparently so hard to get syntax highlighting right
 
Cheapskates using regex
 
4:16 PM
@pxeger The most common engines use brainfuck, so its difficult to fix any bugs
 
@user but so many languages don't have regular grammars for tokenisation. You'd have to be kinda stupid to use regex for that
 
@Wezl Source: It f***s with your brain
@pxeger You're on to something there :)
112
Q: "Hello, World!" in zero lines of code

SisyphusNPM's sloc is a moderately popular tool for counting source lines of code in a file. The tool will attempt to strip out both single and multiline comments and count the remaining lines in order to get an estimate of the 'true' number of lines of code. However, the parser used is based on regular ...

Not quite the same thing, but I'm sure syntax highlighters also use these sorts of techniques
[citation-needed] though
 
@pxeger My guess is that there are lots of different languages that people expect syntax highlighting for (e.g. Python, JS, C, Java, C++, C#, Ruby, Haskell, APL and more all have highlighting on SE). You could create standard tokenisation and highlighting for each, but most use rough guesstimates with additional specificities for each language as it's less payload-heavy
 
^
 
4:24 PM
For example, IDLE gets Python syntax highlighting correct 100% of the time, because it only has to deal with Python. Things like VS or Notepad++ can have massive libraries of highlighting rules per language installed as part of their software because they won't be that big. But, you try and do that on a webpage, and it could take seconds to load which people don't like
 
@Wezl do you know how to picolisp?
 
somewhat
 
do you know why this doesn't terminate?
 
sorry, can't TIO
 
oh my example is unnecessarily complex anyway
(prin 1)
straight up does not terminate
 
4:35 PM
you're missing (bye). picolisp is pretty weird.
 
lol wat
ok thanks
 
it's made to be used a lot from the REPL, so standalone programs need (bye) or (i think) (quit) works
 
So, most syntax highlighting on SE is tag-based (if a question on SO has the tag, it uses Python syntax highlighting). We do have language-specific tags which are generally only used on questions that require answers to be in that language. Tag-based syntax highlighting is currently disabled for the site, but would make sense in this case. So:
CMM: Tag based language syntax highlighting, yay or nay?
 
how often do we get language-specific tags that don't actually restrict submission language, compared to or ones that require that language be used
like for example, a challenge about a python feature / detail that can be implemented in any language
 
4:44 PM
and you can always do:
```python
some code
```
 
yeah
TIO also automatically adds a language header if you are using a highlightable language i believe
 
or
<!-- language-all: python -->
    some code
 
, , , , , , , , , , , , , , , , , , , are our tags that have syntax highlighting available
Yeah, I'm aware that there are other ways to get syntax highlighting, this is just whether it would be worth enabling it for language tags
 
@hyper-neutrino you can use jdoodle.com/ia/eqH to test out how picolisp parses. Note that it prints () as NIL
 
@hyper-neutrino The most recent challenge is tagged , but isn't restricted to lisp answers
 
4:46 PM
my personal opinion is no, we shouldn't have it
is this already a meta post? i've been through too many lately to remember anymore
 
@pxeger If you add that to the question, does it affect the answers?
 
I'd assume not
 
@hyper-neutrino No, I'll turn it into a meta discussion depending on this CMM
 
If only we had a sandbox.SE to test it :þ
 
@pxeger That's the main difference between tag-based highlighting and HTML-based highlighting. IIRC using specific highlighting in an answer overrides the tag-based one tho
 
4:49 PM
@cairdcoinheringaahing Nope. Would mess up every challenge that relates to a language.
 
how does IO work in picolisp
(read) seems to read the next line of source code and inserting input into source code is disallowed
and also really weird
maybe i need to use a function :(
 
Are you writing a picolisp answer for the new challenge? :P
 
... maybe
 
@hyper-neutrino yes, but (read) reads the next form not line, (the code (+ 1 2) can have newlines separating the sub-forms +, 1, and 2)
@hyper-neutrino I'd definitely suggest this. it's much smaller
 
maybe i should use a functional language functionally. :p
 
4:57 PM
@cairdcoinheringaahing You've missed a couple, like coffee. bsh c clj coffee cpp cs csh css dart erlang golang hs html kotlin java js latex lisp lua markdown matlab ml objectivec pascal perl php proto py r rb regex rust scala swift sh sql vb vhdl xml yaml
 
@Peilonrayz Yes, but we don't have tags for some of those (e.g. )
 
@Wezl e.g. '(a(do-stuff-with a] versus (prin(do-stuff-with (read](bye) (not sure if (bye) is necessary)
 
is there a way to do default arguments?
or should i just make a helper
 
@cairdcoinheringaahing Ah, ok
 
@hyper-neutrino software-lab.de/doc/refD.html#default or do [or var (set'var val]
btw (set'var val) is shorter than (setq var val)
 
5:02 PM
ah. thanks
why setq lol
 
tradition?
 
i feel like it should be set! but. ¯\_(ツ)_/¯
 
picolisp is not a very functional language. Scheme is the odd one out there.
 
ah
the only lisp-like language i've used is racket btw :P
 
e.g. picolisp has dynamic scope, no easy closures, no tail recursion, etc.
 
5:04 PM
Bleh
 
no tail recursion?
tf
 
no closures? Even C++ has closures!
 
first class functions are literally lists in picolips, so you can make them yourself
 
I can live without closures, but dynamic scope and no tail recursion sound very annoying
 
Depending on what you mean by dynamic scope, I think I could live that that more than I could closures
And I'm interpreting "no tail recursion" as "no tail-call optimisation", not literally "tail recursion is impossible"
 
5:08 PM
the default language is pretty meh, but tbf it has f-exprs and stuff which makes it pretty extensible. For example it has a built-in prolog DSL (pilog)
 
@pxeger If that's the case, it might not be that bad
 
that's what i figured it meant as well
oh well. python doesn't have it either so i'm used to it
 
Does Jelly have TCO? I can never remember
 
I doubt it, being written in Python
 
@cairdcoinheringaahing most likely not
:/
 
5:14 PM
i think so
ß doesn't terminate
Ȯß successfully outputs all 128 kilobytes of 0s before getting killed
 
oh, huh
 
1߀ segfaults immediately, so it's definitely some optimization
 
:O
 
yeah so it seems that ending a link with just a "call other function" will TCO
Ç}` will segfault but that's to be expected
 
5:17 PM
Isn't }` a no-op?
 
I know that {` is, as ` reuses the left argument, but I'm not sure about }`
 
oh wait maybe it isn't?
F{ is lambda x, y: F(x) so F{` is lambda x: (lambda x, y: F(x))(x, x) which is lambda x: F(x) which is F
F} is lambda x, y: F(y) so F}` is lambda x: (lambda x, y: F(y))(x, x) which is lambda x: F(x) so still F
yeah both are no-ops
 
However, `} isn't a no-op, but `{ is
 
don't think so
 
5:22 PM
`} causes the dyad to be reuse the right argument
 
f` is lambda x: f(x, x) so f`{ is lambda x, y: (lambda x: f(x, x))(x) which is lambda x, y: f(x, x) which isn't equivalent to f anymore
in a monadic chain alone then sure
 
@hyper-neutrino Is this because of a CPython stack overflow? (and also because Jelly does sys.setrecursionlimit(1 << 30)?)
 
but notice here that +`{ gives left + left and +`} gives right + right
 
Does anyone else remember when the Python designers tried to make Python Turing-incomplete by design?
 
@hyper-neutrino Ah yes, `{ is equivalent to `, my mistake
 
5:24 PM
well, sort of
arity is different :p
 
Shame that you can't use ` on monads
Means you have to do <monad>{` (for whatever reason)
 
lol
i figured it'd get dismissed; it's really minor :p
 
I'm surprised that its full on declined rather than deferred
 
5:33 PM
now, what if someone gets two gold tag badges? will they get an upgraded hammer? :p
 
It'd both close and reopen the post with one click :p
 
Nah, it closes the target as a dupe of the dupe :P
 
Thanks, MDN :p
 
wow i'm dumb
2
i made a picolisp answer to a question about picolisp's multi-bracket closing feature... and didn't use picolisp's multi-bracket closing feature...
fixed within grace period :p
 
6:28 PM
@hyper-neutrino You and ASCII-only have said that many times before
 
except since i recently started putting the ' in "i'm dumb" / "i'm stupid" / etc these search results are inaccurately distributed
 
@lyxal You'll be happy to learn SE's not going to mess with your double code-golf tag badge
3
@hyper-neutrino Oddly enough, searching for i'm dumb doesn't yield any results
I hate chat search
 
@user caird already pinged lyxal over that
but i guess fittingly for a double tag badge, lyxal gets a double ping :D
@user s/search/
 
@hyper-neutrino Oh lol
 
@user Get ninja'd :P
 
6:37 PM
@hyper-neutrino s/((?<= )h)|search/
 
I h---ate ---c---hat ---search
good job markdown
 
@user I h ate c h at s hearch
Yum
 
@RedwolfPrograms I h ate c h at s ear ch. That's the best part :P
@hyper-neutrino Quite a bold statement there.
I h a tech at sea rch (stretching it a bit)
Ooh, Python's pattern matching isn't bad
CMP: What's the best way a language/something else has implemented pattern matching?
Elixir's pattern matching is pretty OP
 
ngn
6:45 PM
@user by not having it at all :)
 
@ngn Why do you think so? (not challenging you, just curious)
Or were you just joking making a joke?
 
ngn
generally, the best way to implement something is to avoid the need to implement it
 
@user prolog's pattern matching is very powerful (e.g. A = [1,2|A]), however it does require function scope, which gets in the way of lambdas for example
@ngn this, but you should still implement it anyway
 
ngn
isn't pattern matching just an if-then in disguise?
 
no, because it can also bind variables
 
6:50 PM
@ngn Assuming you're talking about k, what does it do to remove the need for pattern matching?
 
@ngn Kinda, but patterns like Node(left=None, right=Node(1)) gets a bit unwieldy
 
@ngn I guess you could boil everything down to lower-level constructs, but sugar's always good
 
> always
um, no
 
ngn
@Wezl ok, then: if-then + assignment + recursion
 
@Wezl Okay, maybe not in a hamburger :P
 
ngn
6:51 PM
@user nothing to do with k
 
@ngn That can get verbose (not necessarily a bad thing, but it distracts from the task at hand, whatever that may be)
I wish Python had added extractors to its pattern matching PEP :/
 
ngn
@Wezl does A = [1,2|A] make an infinite list A=[1,2,1,2,1,2..]?
 
I think so
 
@ngn I'm not sure that's pattern matching, though
 
ngn
@user then, is there a difference between pattern matching and destructuring assignment?
 

« first day (3782 days earlier)      last day (1065 days later) »