« first day (76 days earlier)      last day (475 days later) » 

4:59 PM
@Upgoat
 
Cool feature for switches?
 
yeah, I have an idea
@Upgoat what are commas used for?
 
nothing yet
 
I've been out of the loop for a while. Does cheddar use semicolons?
 
@CᴏɴᴏʀO'Bʀɪᴇɴ they are optional
 
semicolons are ugly imo
 
@Upgoat ;/
 
:/
 
my idea is a "switch lambda"
 
elaborate? sounds interesting...
 
5:03 PM
okay, so if you're not using commas for anything, then commas within a case statement could refer to multiple case values
 
Maybe a branch-like switch in my opinion
 
switch value {
	case 0, 1: return 1
	else: return 2
}
(this is not a lambda)
 
@CᴏɴᴏʀO'Bʀɪᴇɴ oh, that's a good idea
 
(case word optional)
 
so you're using else instead of default?
ah, so switches are like a literal?
 
5:05 PM
The above would be equivalently as a "switch lambda":
switch* v { 0, 1: 1; else: 2 }
which creates a function that can be called
 
<object>->{
    <value1>:
        statement
    <value2>, <value3>:
        statement
}
 
should I make it then like: foo := switch* v { /* ... */ } or like c: switch* v { /* ... */ } foo
 
oh, hm
probably the former, so it can be anonymous
 
So something like
 
switch -> "switch" "*"? <expression> "{"
    <case>
case -> ("case"|"default")? <expression> ":" <block> <case>
         "}"
nvm got it
 
5:09 PM
Do you have a data entity?
 
no, I don't know what that is :|
 
a piece of information
 
I meant something like
 myValue->{
         1:
             doThis()
         2, 3:
             doThat()
    }
 
@CᴏɴᴏʀO'Bʀɪᴇɴ I tried
 
5:10 PM
I think the -> arrow is already used
 
@Bálint that would be viewed as a lambda
 
Then something else than arrow
Maybe ??
 
that would be confusing in writing though
 
> halp ?? is not wokring
 
5:13 PM
I like switch simply because of the immediate knowledge one knows of its function
except to python programmers, but who cares about those :P
 
^ +1
 
@Upgoat Then maybe actually star it :P
 
@Bálint actually I'll pin it
 
BTW, the multiple value thing is technically possible in other languages as well
case1:
case2:
    statement;
    break;
 
yeah but no one likes breaks
 
5:17 PM
This way statement runs in bith cases
 
in Pytek, May 10 at 14:31, by El'endia Starman
I think we could possibly come up with a better system for that, not just switch statements. For instance, regarding code reuse, there are four kinds of "overlaps" I can think of: 1) overlap at the start, 2) overlap at the end, 3) one case's code is entirely within another, and 4) one case's end overlaps with another case's start.
in Pytek, May 10 at 14:37, by El'endia Starman
Oooh, I think the key ingredient would be to allow, explicitly, a way of executing multiple branches of a conditional (if/else or switch).
 
@Upgoat If you do a traditional switch, then please just use brackets or simply make it only read it until it reaches the next ccase
 
in Pytek, May 12 at 23:48, by quartata
code = \input[SINGLEBYTE]();

tape = [0] * 2^16;
index = 0;

\for(instruction; code) {
  \switch(instruction) {
    "+": tape[index] += 1;
    "-": tape[index] -= 1;
    ">": index += 1;
    "<": index -= 1;
    ",": tape[index] = \getc[SINGLEBYTE]();
    ".": \print(char:tape[index]);
    "]": \hop(\find(code[\pos():0], "[")) \if tape[index];
    default: pass;
  }
}
in Pytek, May 12 at 23:51, by quartata
The switch statement syntax which I think is good
 
what is with all the \s
 
it's like (la)tex
 
5:20 PM
:/ tex is markup not programming lang
 
would everyone shut up about the backslashes for once
 
@Upgoat Does cheddar have do...while loops?
 
anyways these were our thoughts on it
 
@Bálint planning on it
 
5:20 PM
if anyone cares
 
gotta make normal fors work though
 
@quartata thanks
 
@quartata thanks for the input
 
This was the original syntax:
in Pytek, May 10 at 14:40, by El'endia Starman
\switchmulti[x](A){
    #A's start
}(A or B){
    #common code; A's end and B's start
}(B){
    #B's end
}
 
oh I got another idea, to put braces around the thing
 
5:22 PM
Currently we're planning on doing it like this (I think):
\switch(x) {
  A: code
  A \or B: code
  B: code
}
 
that's decent
 
@Upgoat Around the what?
 
switch foo {
    case bar {
        abc;
        def;
    }
}
 
I don't like the way that looks
 
D: okay
 
5:23 PM
You have to keep in mind switch-case is for small things really
It's to be used sparingly in place of if-else
 
4 mins ago, by Bálint
@Upgoat If you do a traditional switch, then please just use brackets or simply make it only read it until it reaches the next ccase
 
I coud allow braces+multline or :+singeline
that would inspire good practice
 
@quartata true
 
:D it works in JS
> switch(true) {
	case true: {
		console.log("true");
	}
}
[Log] true
 
@Upgoat works in JS:
{
    <statement>
}
It's called scoping
 
5:24 PM
@Bálint Yeah, anonymous block. Lots of languages have that. I personally like them
 
@quartata I know, but some languages name it that
 
switch -> "switch" "*"? <expression> "{"
    <case>
case -> ("case" | "default")? <expression> <case_block> <case>
        "}"
case_block -> "{" <code_block> "}"
              ":" <statement>
@Bálint i know
 
you may get stars for your hideous work in TNB, but here you're amongst JS programmers.
 
@quartata except in ES6
 
5:25 PM
@Upgoat except it still doesn't make a new scope in es6 you have to use let
 
2 messages moved to Trash
 
{
  let a = 3;
}
a; // ReferenceError: a is not defined
 
removed blasphemy
^^ :D
 
@quartata because var declares a variable in the window.
 
@CᴏɴᴏʀO'Bʀɪᴇɴ which is disgusting
anyways
you already know this
 
5:26 PM
@quartata You could interpret it as JS having more feature
 
@quartata global variables have their place.
 
@quartata which is why I'm advocating use of babel
 
@CᴏɴᴏʀO'Bʀɪᴇɴ I don't think so
var doesn't declare a global variable
 
@Bálint It declares a variable to the window.
 
Yeah, it's local in a function
 
5:28 PM
though declaring scopes is bad practice as it's slow and confusing so I kinda understand why JS did it
 
@Upgoat kek
 
> let a = 3;
< undefined
> window.a;
< undefined
> var b = 3;
< undefined
> window.b;
< 3
 
@CᴏɴᴏʀO'Bʀɪᴇɴ :| does your browser not support let
oh wait nvm
 
it does
the window, remember
same thing with globals in node
 
huh TIL
 
5:29 PM
@CᴏɴᴏʀO'Bʀɪᴇɴ Only if you use it in the global scope
 
@Bálint That's only what I'm talking about.
var serves its purpose when you want to manipulate a variable given its name without using eval.
 
@CᴏɴᴏʀO'Bʀɪᴇɴ BTW, the window object is the global scope
window.innerWidth = innerWidth
 
No, it isn't. Don't abuse bold.
 
window.eval = eval
 
a can be accessed globally, but isn't in window.
did you read the code snippet...?
 
5:31 PM
cheddar> var a := 5
cheddar> if a == 4 { print "Cheese is borked" } else { print "Nope" }
Cheese is borked
ono
 
@Upgoat Did you try a != 5?
as the condition
 
idk 5 == 4 works, something with the referencing
 
@Upgoat As a windows user, how can I get a cheddar interpreter/compiler/I don't know
 
@Upgoat Can I file this issue?
 
5:34 PM
I use windows and I still don't know
 
then go to the windows downloads
@zʏᴀʙiɴ101 ok, sure
 
@zʏᴀʙiɴ101 we're aware of the problem, there is no point in posting an issue
 
though I really need to fix Cheddar's GH... my git workflow is messed up
but that would requre me to either A) reset all commit history B) live with shit commit messages
 
@Upgoat Done, now what?
 
did the installation script work?
 
5:36 PM
It started, then stopped immedialitely
@Upgoat Wait, does it need node?
 
yeah
@CᴏɴᴏʀO'Bʀɪᴇɴ do you know if can MSI installers do HTTP requests?
 
¯\_(ツ)_/¯
Never wrote one
 
can you write one for cheddar :3 :3 :3
 
I don't know how :P
 
I dont have windows so I cant do it either ;-;
 
5:39 PM
Maybe a NSIS installer?
 
I'll look into it
 
idk what the difference is
i can make pkg installer for make though
 
@Upgoat Now I have node, but still stops immedialitely
 
okay, do you have npm?
 
@Upgoat Yup
That comes with node
 
5:41 PM
okay. Try doing: git clone http://github.com/cheddar-lang/Cheddar.git
 
@Upgoat Done
 
okay, now CD to the created Cheddar dir
then run npm install
 
> Jade has been renamed to pug
That's the worst renaming I've seen in a while
 
If cheddar is node-based, then why the hell did you use babel?
And install is done
 
5:49 PM
babel-node
 
@CᴏɴᴏʀO'Bʀɪᴇɴ Node supports ES6
So, now what?
 
the goat likes to think that not all of es6 is supported
 
@Upgoat Installation is done, now what?
 
okay, check if a dist directory is there
 
Where?
Yes there is
 
6:07 PM
Okay good
npw run....
node.exe ./dist/cli/repl.js
 
Still not done is it?
 
No I ate all the cheese so now I have to wait for new
 
I remember a couple of weeks ago
"I'm almost done" - Upgoat
 
:|
i don't know what your taking about
 
oh you know
 
6:12 PM
._.
 
@Upgoat referenceError: dist is not defined
 
Wat
is that node error or bash error
 
node error
 
Shit
Cantou
 
at repl:1:1
repl.js:262:27
 
6:15 PM
Wat
@Bálint can you post that as an issue to GH and describe the errors your getting etc.?
 
Wait, I done it
I simply entered the command node D:\Cheddar\dist\cli\repl.js
and it works now
Now, how do I interpret a cheddar code
@Upg
 
:D
dies REPL show up?
 
I get a yellow cheddar>
 
:D it's eitking
* working
just enter cheddar code and hit enter to run it
 
@Upgoat That was not even close...
Symbol(KEY_NOT_FOUND)
:DDDD
It works!
I'm officially a cheddarian!
 
6:24 PM
😄😄😄😄😄😄😄
 
But is there a way, to use a separate file?
 
Yeah
instead of repl.js use prog.js
 
@Upgoat How?
 
like:
node D:\Cheddar\dist\cli\prog.js myfile.cdr
 
Nothing
 
6:54 PM
D:
try using the git shell
 
7:22 PM
@Bálint maybe try using node D:\Cheddar\dist\cli\cheddar.js < myfile.cdr
 
 
3 hours later…
10:19 PM
Cheddar's Switch (lambda?) Proposal! If you'd like to comment, suggest a change or anything, feel free to leave a comment, or if you have edit access, edit the proposal (but leave a footnote describing your changes)
4
 

« first day (76 days earlier)      last day (475 days later) »