« first day (1896 days earlier)      last day (2932 days later) » 

10:00 PM
@ChrisJester-Young this is also always an eye-opener for people
lambda n: (lambda f: f(f, n))(lambda f, n: f(f, n-1) + f(f, n-2) if n > 1 else 1)
 
@ChrisJester-Young Is 0 falsy in Racket?
Like can I do (if (% n 15) or do I have to do (if (= (% n 15) 0)
 
Pretty cool youtube metadata thingy: h3xed.com/blogmedia/youtube-info.php
 
@ChrisJester-Young or the slightly more difficult to understand but more fundamental
(lambda f: f(f))(lambda f: lambda n: f(f)(n-1) + f(f)(n-2) if n > 1 else 1)
 
((()()))()))()()()()()())((()))()())((()()
( ͡° ͜ʖ ͡°)
 
Should I allow tabs for indentation in Cheddar?
 
10:06 PM
@Downgoat no
 
@quartata that's what I was thinking
 
@Downgoat Of course.
 
no
 
@QPaysTaxes programming languages should promote good practive
 
@Downgoat no
friendly reminder of google code jam
 
@Downgoat either tabs or spaces.... only let one.
 
Either.
Let the programmer do what suits them best.
If you ban tabs I swear I will not use the language ಠ_ಠ
 
@El'endiaStarman but then you end up with no standards. Python is an amazing language because it enforces and encourages good programming practices
 
10:09 PM
@CᴏɴᴏʀO'Bʀɪᴇɴ okay, fine, I'll allow tabs
 
^^
@Downgoat merci :D
 
@quartata No.
 
@ChrisJester-Young OK.
 
@quartata There is only one falsy value in Scheme, and it's #f.
 
@NathanMerrill s/n amazing//
 
10:10 PM
@QPaysTaxes I'm pretty sure this whitespace stuff in python is an enforcement
 
should it throw a syntax error or a warning if both indentation are used?
ok, going with syntax error :P
 
@Downgoat warning yes
 
@QPaysTaxes Why bother? The syntax isn't from sed.
 
what should the error message be?
 
It'd be pointless to include it in conversation anyway.
 
10:12 PM
> Warning: WTF are you doing using both tabs and spaces, you crazy?
 
Warning: Waffles
 
@QPaysTaxes that works too...
> Warning: Pick tabs, spaces, or the waffle emoji and stick with it dumbass
 
@orlp Uh, lemme read.
 
should I allow waffles for indentation?
 
@Downgoat Better: "Warning: you will be slapped with a trout if you continue in your wrong practices."
^
 
10:13 PM
It'd be fantastic to have an editor that fixed indentation to whichever style you wanted.
@QPaysTaxes People will find it by looking at the code.
 
What chars should be allowed in variable names?
 
@orlp Lemme guess. That's some variant of Y combinator?
 
@El'endiaStarman obsfucation
 
10:15 PM
@ChrisJester-Young it's in the direction, but it's not proper yet :)
 
@Downgoat I only said "whales" because if you include BS options you're going to get BS answers. :P
 
you can't just throw someone the Y combinator in the face and expect them to understand it
 
^^
XD
turing completeness proof method
*very general
@QPaysTaxes "TCS"?
 
#lang racket
(define fizzbuzz (lambda (n) (if (= (modulo n 15) 0) "FizzBuzz" (if (= (modulo n 5) 0) "Buzz" (if (= (modulo n 3) 0) "Fizz" (number->string n))))))
(for ([n (in-range 1 100)]) (display (string-append (fizzbuzz n) "\n")))
I made a thing
 
@QPaysTaxes oic
 
10:17 PM
@QPaysTaxes Computational complexity theory is the specific field for that kinda thing
 
@quartata noic
 
@QPaysTaxes Yes
 
@CᴏɴᴏʀO'Bʀɪᴇɴ what do I post
 
Lower camel case because that's objectively the best
 
10:22 PM
@quartata incorrect
 
@AlexA. *correct
Doesn't Julia use lowerCamelCase too?
 
Never
 
Really?
 
Yep
Type names are UpperCamelCase and everything else is all lowercase
or snake_case
 
Snake case is OK
I use that for functions sometimes if I think it looks better
Never for variables though
 
10:24 PM
@AlexA. UserCamelCase is called PascalCase
 
I've heard both
 
Sorry to plug Minecraft so much, but this was fun:
 
@HelkaHomba woah, since when can you fly?!?
 
@Downgoat Since 1.9.
You can get Elytra from End Ships in the End.
 
oh
 
I haven't played since 1.8
 
@HelkaHomba holy macmadoodles what is that giant crater in the side of the mountain there
Is this at spawn?
Oh wait
It's not.
 
ppcg mc server?
 
I was feeling panicky for a second.. I thought something bad had happened to the spawn plateau
 
A description of how a variable should be parsed, e.g., only alphabetic
 
10:27 PM
@CᴏɴᴏʀO'Bʀɪᴇɴ I submitted [$_\u{L}][$_\u{L}\d]*
is that right?
 
idk what \u{L} is
 
regex
 
I know that.
But isn't \u a unicode escape?
 
Not in a regex.
 
@CᴏɴᴏʀO'Bʀɪᴇɴ it is PCRE REGEX
 
10:28 PM
http://chat.stackexchange.com/rooms/38119/three-word-chat

join us :)
 
Join us :)
 
@HelkaHomba is the PPCG minecraft server an online server or an offline server?
 
@Downgoat Online.
 
D:
 
10:30 PM
I take that to mean you have cracked
 
@Downgoat If you have a legit Minecraft account you're welcome to join
 
@quartata Decline to answer :|
 
@quartata Would you like some feedback on your code? :-)
 
@ChrisJester-Young Yes I'm sure it looks ugly to a good Scheme programmer
@Downgoat You really should just buy the game... :/ It's a good game and worth the weight money
 
@quartata if I buy it I will waste all my time playing it
 
10:32 PM
@quartata I'm not saying "ugly", but more...unidiomatic. :-)
 
I seem to recall there's another function that's better than nesting ifs like that
 
@quartata Sure, cond.
 
I also felt a little guilty using a for because I know it's not idiomatic
 
@quartata for is very idiomatic.
 
I could map instead probably.
 
10:33 PM
@quartata Do not use map instead.
 
@ChrisJester-Young It is? I didn't really think it's something you use a lot in functional languages in general
@ChrisJester-Young ok
Lemme see how cond works real quick
 
@quartata A for is called an eager comprehension. There are variants of this, most notably for/list, which is a list comprehension.
Racket's implementation of for is very, very functional, with no mutation or anything dirty.
 
Pyth highlighter anyone?
 
cond is like (cond [cond1 body1] [cond2 body2]... right?
That's probably a lot better
 
@quartata Yep.
Also Scheme has case, which works like switch in C-like languages.
 
10:35 PM
How can I do a pure else in (cond?
 
Use else.
 
Oh well der
#lang racket
(define fizzbuzz (lambda (n) (cond [(= (modulo n 15) 0) "FizzBuzz"] [(= (modulo n 5) 0) "Buzz"] [(= (modulo n 3) 0) "Fizz"] [else (number->string n)])))
(for ([n (in-range 1 100)]) (display (string-append (fizzbuzz n) "\n")))
ahh so much less parens
Are the parens around [n (in-range 1 100)] necessary?
 
@KennyLau I was working on one for Vim but I haven't had much time for it recently.
 
@quartata Yes.
 
OK.
 
10:37 PM
@AlexA. It's fairly simple, because each letter has a fixed arity
 
Just wondering since there weren't any in the cond clauses
 
@quartata All right, ready for the rest of my comments, or do you want to do more tidyups first? ;-)
 
Go right ahead :)
 
@KennyLau I know. I wasn't doing it based on arity though, just by type of token (operator, constant, string, etc.).
 
@ChrisJester-Young the Y combinator is a bit more complicated
comb = (lambda c: lambda f: f(lambda x: c(c)(f)(x)))(lambda c: lambda f: f(lambda x: c(c)(f)(x)))
 
10:38 PM
@AlexA. But you would need to use arity to do pyth?
 
in return, it allows for really nice recursive functions
 
The #s might be more complicated
020 -> 0 and 20
 
fib = comb(lambda f: lambda n: f(n-1) + f(n-2) if n > 1 else 1)
 
@quartata Okay. 1. Use (zero? x) instead of (= x 0). 2. It's okay to return n in the else case instead of coercing it to a string, because in a minute I'll nuke the string-append. 3. You can use displayln to display an object then print a newline. Alternatively you can use (format "~a~%" x) for something more complicated than just printing x and a newline. 4. You have an off-by-one error. (in-range 1 100) counts from 1 to 99 inclusive.
 
@KennyLau I'm not sure what you mean. All operators are being given the same color.
 
10:40 PM
@orlp Yepyep.
 
@ChrisJester-Young I know (in-range is inclusive, I only wanted 1 to 99
 
@AlexA. But we often have nested operators...
 
I didn't know about (displayln though thanks
and (zero? is nice
 
@quartata Okay.
 
@KennyLau I know. It's just basic highlighting, as you would have with any other language. For example, nested for loops in language X are all colored the same color.
 
10:41 PM
@quartata Note that displayln, for, and format are Racketisms and you can't use them in standard Scheme code. That's what I mean about Racket being more batteries-included.
 
@AlexA. I see.
 
#lang racket
(define fizzbuzz (lambda (n) (cond [(zero? (modulo n 15)) "FizzBuzz"] [(zero? (modulo n 5)) "Buzz"] [(zero? (modulo n 3)) "Fizz"] [else n])))
(for ([n (in-range 1 100)]) (displayln (fizzbuzz n)))
@ChrisJester-Young Ah
 
@AlexA. I have an unrefined code here
J2.nm*]sm*C.RcsmsmC@@Qbd,khk,dhd4ZJ:0lhQJJ:0lQJ
 
@quartata Yep, pretty good. There's one further trick I use in my own version of FizzBuzz, but you're under absolutely no obligation to use it:
 
@Winny Hey! Haven't seen you around in a while.
 
10:43 PM
(define (fizzbuzz n)
  (case (modulo n 15)
    [(0) "FizzBuzz"]
    [(3 6 9 12) "Fizz"]
    [(5 10) "Buzz"]
    [else n]))
 
@KennyLau Um, okay. Cool.
 
J2.nm*]sm*C.RcsmsmC@@Qbd,khk,dhd4ZJ:0lhQJJ:0lQJ
ONOOOOOOOOOOOOOOOOOOOCOOOOOOOOOONCOONOOOOOONOOO
 
hi @AlexA. nod @ChrisJester-Young
 
'\o
 
10:44 PM
@AlexA. O for operator, N for number, C for constant
 
nice fizzbuzz, using case, never considered that
 
That's basically what you get for a typical code
 
Yep
It's not going to be all that useful, just simple.
 
@AlexA. Might be better if you would highlight 0-arity (numbers + constants) 1-arity 2-arity 3-arity separately
 
it's great to see fellow racketeers online
 
10:45 PM
@KennyLau I've considered it. Just not sure whether I care enough to do it. :P
 
I need to come up with a better demonym for that...
 
@AlexA. As you will.
 
@Winny Racketball players
 
@AlexA. :D that makes us sound like health nuts
 
Haha
 
10:47 PM
@ChrisJester-Young Oh, that's a nice way too.
 
@Winny Racketeers is the correct term.
 
Btw @Winny is your avatar from Rocko's Modern Life or something? :P
 
@Winny I wouldn't really consider myself a "Racketeer" since I just started learning a half-hour ago
 
@Winny Thanks!
 
@AlexA. I think it's an 80s or 90s pattern used on cups or something
 
10:49 PM
Oh okay
 
@quartata :-D
 
@quartata you're a racketeer in my book :D
 
@quartata I'd consider you more of a racketball player
 
@AlexA. I have played racketball once
 
That's more than I have. How was it?
I used to have a racketball because they're super bouncy and I was like 10 but I didn't have a racket or anything.
 
10:52 PM
idk I think I was also 10 so I can't remember really
 
I feel like racketball is kind of dangerous for 10-year-olds
Isn't it?
Well, perhaps no more than other sports
Probably. My sister played soccer. I played stay inside.
 
Stay inside is my favorite sport
 
I'm super good at it. Professional level, you might say.
 
0
Q: "Stair-ify" a string

Dr Green Eggs and Ham DJYou must write a program or function that creates a "stair-ified" string. Here is how you "stair-ify" a string: For each character in the string: If the character is an upper or lowercase vowel, not including 'y', output it then move the rest of the string up a column. If the character is a sp...

 
@ChrisJester-Young are you guys going to be discussing the problems during the qualifiers?
 
10:57 PM
@AlexA. I suspect this site is full of professionals.
 
(in the irc challenge?)
 
@HelkaHomba You're probably right.
I wonder how many of the users here actually like being outside.
I do, just... within reason. :P
 
@NathanMerrill Hell no.
 
I like seeing snow from inside the comfort of my home. I don't like being out in it.
 
Ooh, starting in less than a minute.
 
10:59 PM
its allowed
 
What is?
 
google code jam
 
For me, beer o'clock started a couple minutes ago
 

« first day (1896 days earlier)      last day (2932 days later) »