« first day (1912 days earlier)      last day (2934 days later) » 

10:00 PM
And 2+2+2?
 
> new CheddarEval(new CheddarShuntingYard().exec(new CheddarExpression("2+2+2", 0).exec())).exec()
< CheddarNumber { value: 6 }
@quartata ^
 
10/10 it's ok
 
What happens if you s/0/1/?
 
10:05 PM
What happens if you s/Cheddar/Gouda ?
 
the interpreter barfs
 
What's wrong with Gouda?
 
6
Q: Where to store framework code for challenges?

flawrSome challenges are provided with some kind of framework in which the submissions should be ran in, e.g. king-of-the-hill challenges. I wrote the catch the cat challenge, which needs several files for the controller. These are currently stored as a gist. Recently I wanted to delete my github ac...

 
@El'endiaStarman then it will start parsing at index 1
 
Have you defined monadic +?
 
10:17 PM
@QPaysTaxes yeah
@CᴏɴᴏʀO'Bʀɪᴇɴ yeah
 
In computer science, the shunting-yard algorithm is a method for parsing mathematical expressions specified in infix notation. It can be used to produce either a postfix notation string, also known as Reverse Polish notation (RPN), or an abstract syntax tree (AST). The algorithm was invented by Edsger Dijkstra and named the "shunting yard" algorithm because its operation resembles that of a railroad shunting yard. Dijkstra first described the Shunting Yard Algorithm in the Mathematisch Centrum report MR 34/61. Like the evaluation of RPN, the shunting yard algorithm is stack-based. Infix expressions...
 
@QPaysTaxes It does ShuntingYard
is converts infix -> RPN
 
@Downgoat What does it do?
 
@CᴏɴᴏʀO'Bʀɪᴇɴ it parses infix expressions
 
I know what the algorithm is, I'm asking about the monadic case of +
 
10:19 PM
@CᴏɴᴏʀO'Bʀɪᴇɴ lel
 
I read it as "shouting yard".
 
HEY YOU! GET OFF MY YARD!
 
@CᴏɴᴏʀO'Bʀɪᴇɴ nothing
 
So you haven't defined it...
 
@CᴏɴᴏʀO'Bʀɪᴇɴ what should it do?
 
10:21 PM
^
It just does return new this.constructor(this.value)
 
@QPaysTaxes absolute value?
 
So, clones it?
 
why would it ever do that?
oh, I was scared for a second there
 
It could take the sign of something
 
@QPaysTaxes btw did your dad ever do the telemarketer app?
 
10:23 PM
@CᴏɴᴏʀO'Bʀɪᴇɴ yeah
 
Unary plus usually has no effect whatsoever. But it's important for interaction with other unary operators
 
@quartata in what case?
 
> Unary "+" has no effect whatsoever, even on strings. It is useful syntactically for separating a function name from a parenthesized expression that would otherwise be interpreted as the complete list of function arguments.
From perldoc perlops
 
oh
 
10:27 PM
Kinda language dependent obviously but from what I've seen you might encounter similar issues in Cheddar with its unary operators/functions
 
so like foo+(1+2)
 
Yeah, exactly.
 
or the variable foo
 
@QPaysTaxes Actually, in Perl it would mean the list operator foo on the list with elements 1+2
Without the unary plus it could mean a function taking 1+2 or a list operator. (It would be parsed as a function)
I think Cheddar has a similar concept of list operators which is why I brought it up.
@QPaysTaxes Not really. It has to do with how calling a function tacitly works.
Oh, that's because there's no space:P
foo +(1+2) is that more clear?
(See this is why we have backslashes on functions/operators in Pytek)
Apr 18 at 23:24, by QPaysTaxes
@quartata What is it with you and backslashes?
now you know
 
10:32 PM
@Downgoat Ooh, okay. Why do you have that feature?
 
@El'endiaStarman In the tokenizer, the code is passed by reference, so by passing the index to parsers, I don't have to duplicate the code, I just store the index.
 
Cool language: github.com/nasser/---
Created as a way for native Arabic speakers to have intuition about the code they're writing, rather than memorizing a way to manipulate symbols that have no meaning in their language (e.g. do, for, etc.)
I think that's super cool
 
if that was his goal, a transpiler probably would have been enough…
 
¯\_(ツ)_/¯
 
@AlexA. star for JS
 
10:58 PM
What should the result be for when an array is cast to a string?
[1, 2, 3]? 1,2,3? 123? 1 2 3?
 
@Downgoat Ahh, neat.
 
@Downgoat the former
 
@CᴏɴᴏʀO'Bʀɪᴇɴ [1, 2, 3]?
 
[1,2,3]
 
[1, 2, 3]
Yeah
 
11:01 PM
yeah, I can't read
blame hooves
 
I think it'd be better without the spaces, i.e. [1,2,3] rather than [1, 2, 3]
More compact for display
Shorter to parse
 
Yes, but spaces help with readability. Incidentally, Python puts spaces between elements.
 
Yeah, but that's Python. :P
 
Exactly.
 
11:03 PM
The third option is basically a war crime
 
One that not even Hitler was guilty of!
 
\o/ \o/ \o/ \o/ STDOUT works
 
@AlexA. is there any language that does that?
 
Not that I know of
 
@Maltysen yeah, JavaScript
 
11:06 PM
JS does 1, 2, 3
So no
 
JavaScript prints arrays as [ 1, 2, 3 ]?
 
@Downgoat js does some other weird shit with array string repr
 
@AlexA. in a REPL, yeah
 
:/
 
@quartata it does [ 1, 2, 3 ] in a repl
 
11:07 PM
@Downgoat which repl?
 
No it doesn't.
 
chrome dev console gives what quartata said
 
@Maltysen JS Shell, spidermonkey 38
 
@Downgoat well that's spidermonkey's fault
 
11:07 PM
yeah
 
but for some reason, single element arrays like [1] give 1
 
Technically everything wrong with JS is spidermonkey's fault
 
Anyone want to help me implement number operators in Cheddar?
 
YES
what are those
 
@CᴏɴᴏʀO'Bʀɪᴇɴ ಠ_ಠ
 
11:09 PM
i'm guessing + - * / ^ %
 
yeah. but I have a lot more
 
@Downgoat its making me sign in
 
'!', '^', '*', '/', '%', '+', '-', '<=', '>=', '<', '>', '=', '&', '|',
'!=', ':=', '+=', '-=', '*=', '/=', '^=', '%=', '&=', '|=', '<<', '>>', '<<=', '>>=',
'and', 'or', 'xor',
// Unary operators
'-', '+',
'sqrt', 'cbrt',
'sin', 'cos', 'tan',
'acos', 'asin', 'atan',
'log', 'log2', 'log10',
'floor', 'ceil', 'round',
'len', 'reverse',
'sign',
@Maltysen yeah you need a C9 account
 
You can log in with GitHub.
 
@quartata cool
@quartata its giving me an error :/
whatever
 
...
 
@quartata @Phrancis @Mat'sMug
HAI
 
oh shit I left youtube running on autoplay last night
 
@Quill nice
 
11:36 PM
user image
4
 
@Quill roflmao
 
0
Q: Watson-Crick palindromes

milesProblem Create a function that can determine whether or not an arbitrary DNA string is a Watson-Crick palindrome. The function will take a DNA string and output a true value if the string is a Watson-Crick palindrome and a false value if it is not. (True and False can also be represented as 1 a...

 
@CᴏɴᴏʀO'Bʀɪᴇɴ you wanna help with FOG docs?
 
shit, that question has 2 answers before NMP got it. noice
 
11:37 PM
There's another three pages of Lana Del Ray >_<
 
@CᴏɴᴏʀO'Bʀɪᴇɴ :3
@Quill more roflmao
 
@EasterlyIrk kk
 
@Quill well of course. A ray goes on forever in a direction
5
 
I'll just write it into the wiki
 
I have a bit workingish
like main page
 
11:39 PM
Somehow it got to that from this: youtube.com/watch?v=b7xRNspm1Sg
 
OK, I think I'm finally about to get this working as soon as I learn how to C++ virtual correctly
 
I'll start on a CLA version of FOG and a page explaining it.
 
Command Line Arguements.
 
11:40 PM
@quartata Get what working?
 
ie python fog.py code input input_2 ... input_n ... rick_astley
 
@feersum I'm trying to use Pepper to make a version of Perl for use in browsers (i.e in place of JavaScript)
 
@quartata ಠ_ಠ why would oyu ever replace javscript
 
11:41 PM
Do the standard releases of Chrom(ium) actually have that? Or do you have to build it special?
 
I'm pretty bad at C++ though. I much prefer plain old C
@feersum Pepper? Chrome comes with pNaCl by default I'm pretty sure
@EasterlyIrk Why are you agreeing with him?
@Downgoat because
 
JavaScript is too good?
 
At any rate I don't need pNaCl. I can also use pepper.js
 
because of javascript > perl + ∞
 
@Downgoat Ha, you wish.
 
11:43 PM
I don't get it.. how could some JS replace the ability to run native code?
 
@feersum Pepper.js uses emscripten
Emscripten in turn is a transpiler from LLVM instructions to JS
 
Ah right... I've heard of that but kind didn't believe that it actually works.
 
@Downgoat By the way, the fact that someone went to all the effort to make something as incredible as Emscripten so that you don't have to use JS must mean that JS really sucks
Just a thought.
 
Should & or and/AND be logical and?
 
& should be bitwise, && should be logical
 
11:44 PM
and
 
@feersum Same here. Pretty cool stuff.
 
^
or go the python route and use words
 
@Maltysen that is what I'm doing
 
And should and be case-irrespective, or should it have a fixed case?
 
Why do you have to have semicolons after classes?
This makes no sense
 
11:47 PM
you should follow the ArnoldC syntax
 
That's inherited from C, hehe
 
Or CONSIDER THAT A DIVORCE
And KNOCK KNOCK
 
@feersum Functions don't need semicolons after them. Structures needing semicolons makes sense because either you're using them in a typedef which is a statement or you're defining a variable with an anonymous structure
 
@Quill Wrong C. :P
 
@quartata Wait what? You're saying it makes sense but the previous message was "This makes no sense"
 
11:50 PM
@feersum But those are C structures I'm talking about.
C++ classes get defined all by themselves, kinda like a function
 
@quartata what language?
 
In C++, structs and classes are exactly the same (except the default access modifier).
 
@feersum You said classes needing semicolons at the end was inherited from C. I assumed you were talking about structures needing semicolons
I was then explaining why C structures should need semicolons but C++ classes should not
I know, I'm a pedant
 
It wouldn't make sense to have them different becaunse they offer identical functionality.
 
C structures, not C++ structures.
 
11:53 PM
C++ is generally backwards compatible with C though, so the same situation necessitating semicolons can still exist.
 
Structures can't be used in a typedef in C++
(errr, can they?)
 
user image
2
 
Works for me.
 
Duolingo pls >_<
 
typedef struct { int astnh; } mnet;
 
11:55 PM
WHAT
But.. that makes no sense...
 
What should the unary range do?
e.g. ..5
 
@CᴏɴᴏʀO'Bʀɪᴇɴ be a syntax error because that looks ugly
 
It defines mnet as an alias for an unnamed struct type.
 
@feersum But structures are classes with private access no
And you can't have classes like that.... can you?
If so wow that's gross
 
GCC accepts it, haha.
typedef class...
 
11:57 PM
blergh
 
@Quill really from duolingo?
 
yeah
 
rofl
 

« first day (1912 days earlier)      last day (2934 days later) »