What are ya coding Sup Forums?
Previous thread:
/dpt/ - Daily Programming Thread
Other urls found in this thread:
wolframalpha.com
scheme-reports.org
twitter.com
A pajeet detector
A character creator for Pathfinder using the reference document.
OpenGL for newb graphics programming?
How is that a question?
I have been planning for some time to do an efficient multitasking system. Not that I need it or have anything to use it with. I write high performance code for the sheer autism of it.
In C++, why does this compile just fine:
template
struct Foo{
int x=0;;
};
struct Bar{
template
struct Baz : Foo{
void test(){
x;
}
};
};
But this doesn't:
template
struct Foo{
int x=0;;
};
struct Bar{
template
struct Baz : Foo{
void test(){
x;
}
};
};
Because C++ is a brainlet.
What's the difference
>struct Baz : Foo
>struct Baz : Foo
What's the error?
Because that's not how you do template specializations in C++
Who else here /license hobby code as GPL, but willing to let indie gamedevs use it under BSD/MIT for free/?
x was not declared in this scope
Sorry, my example wasn't very clear. In the first, the Foo template is passed a literal and in the second Baz passes it it's own template parameter.
>Because that's not how you do template specializations in C++
So that's the power of the sepples fag... Care to elaborate on why exactly it does not work?
It's not a specialization.
Because Foo references a template argument and that class could have additional specialisations, so the compiler doesn't know what the fuck x is.
Weird.
Template specialization was a mistake.
Undefined behavior:
(+ (begin (display "Hello") 2) (begin (display " World") 2))
Can't even escape nasal demons outside of C.
>Template specialization was a mistake.
It's a great tool when you need it, it just happens to also be a good way to accidentally cut your balls off.
Is there anyway to fix this?
Defined Behavior:
(+ (progn (format t "Hello") 2)
(progn (format t " World") 2))
That's simply print "Hello World" and return 4. How do you figure it's undefined behavior?
Probably. Depends exactly what you're trying to achieve.
undefined behavior
[code
(define x "5")
(display x)
[/code]
Should I use GPL or BSD?
GPL
if you are faggot choose BSD, though
Why not release it as BSD in the first place?
FUCK
neither
It's undefined behavior because in R5RS order of argument evaluation is undefined because "muh potential very obscure optimizations."
Except that's bullshit because they have another clause which prevents such optimizations from occurring in practice. So all they did was allow for obscure cross-platform bugs.
>Note: In contrast to other dialects of Lisp, the order of evaluation is unspecified, and the operator expression and the operand expressions are always evaluated with the same evaluation rules.
>Note: Although the order of evaluation is otherwise unspecified, the effect of any concurrent evaluation of the operator and operand expressions is constrained to be consistent with some sequential order of evaluation. The order of evaluation may be chosen differently for each procedure call.
GPL is a communist plot
BSD is cucked
begin returns the value of last expression you fucking retard
Then why use it?
>R5RS order of argument evaluation is undefined because "muh potential very obscure optimizations."
Sounds like something straight out of C-land. I didn't know Scheme, of all things, would act like that.
>Picking anything but MIT
>begin returns the value of last expression you fucking retard
He's saying that the standard does not define which argument to + is evaluated first, so it could print either WorldHello or Hello World.
Finally decided to write up the web server I've been meaning to. I don't even think this will take the entire night
doesn't matter. He doesn't call newline so the text is never flushed. If that's the whole program it might not print anything.
The side effects are undefined baka.
On my scheme box:
>(foo)
Hello World4
On a technically compliant but evil Scheme box:
>(foo)
WorldHello4
Not undefined. R5RS specifies that it would write 5 to the current input port without quotes.
...
Because then anybody could use it without having to contribute back to the community
I'm a C zealot, what languages should I learn if I want to be employable?
Should I just bite the bullet and start writing webapps with nodejs backend?
No memes please, I don't want to starve.
My previous plan of being a live-in maid bf at some user's house with free food and rent isn't working out too well, it turns out they don't have any money.
If this is the case, then why does this work?
template
struct Foo{
int x=0;;
};
struct Bar{
template
struct Baz : Foo{
void test(){
Foo::x;
}
};
};
dumb rust false flagger
What makes you think I haven't set current-output-port to something else?
Side effects nigga.
you shouldn't
i never mentioned R5RS
Has anyone actually contributed to your GPL hobby code?
C+Python+Java+js with nodejs. Should cover most jobs.
Ruby if you want to work in Japan.
I'm a Rust zealot, what languages should I learn if I want to be employable?
Should I just bite the bullet and start writing real apps in C++?
No memes please, I don't want to starve.
My previous plan of getting free shit under Bernie's socialist utopia isn't working out too well, it turns out he just took the money I earned from working at starbucks.
hello schizo
>replying to yourself
>calling yourself a schizo
hello schizos
>doubles are a subset of integers
>arrays are pointers
>abstract classes are interfaces
>union type punning is undefined behavior
>everyone else is a schizo
Mental illness.
whomst are you quoting?
I'm glad I don't have to deal with this shit in Common Lisp. Fuckin Scheme fags.
>doubles are a subset of integers
Wut
You. I'm keeping track of your brilliant observations.
Learning Haskell
you keep believing that sweetie
>the good old /qa/ routine
But you do have to deal with #' no tail call optimization, () evaluating to false, and (car ()) returning ().
>() evaluating to false
Fuck. I mean () being false.
javascript
>But you do have to deal with #' no tail call optimization, () evaluating to false, and (car ()) returning ().
>tfw coding in a custom lisp
>tfw don't have to deal with any of this fuckery
>(+ (begin (display "Hello") 2) (begin (display " World") 2))
>works on MY machine
Nice job not understanding what undefined behaviour is.
>he doesn't know what undefined behavior means
I think scratch might be the programming language for you user.
>failing to understand what undefined behavior is
Way to go, stupid!
Not the same guy, but I would guess that it does indeed have to do with the I class being indeterminate and being unable to resolve x, but when you specify that you're trying to resolve Foo's x in particular and not some other x that could somehow exist, it compiles.
Stated differently, I would guess that the reason your first example worked is because you passed the compiler a constant argument to the template, it's able to construct the Foo template structure and resolve x. Meanwhile, if the argument is variable, it can't construct the struct. But in this last example, it can realize that there is an "x" variable specific to the Foo class template which is guaranteed to exist, and so in layman's terms it's like saying "if you mean THAT x in particular, then we can do that."
I'm honestly surprised any of it compiles at all and I would expect you to have to explicitly state Foo.x/Foo::X no matter what.
tl;dr If the compiler can construct the Foo template(which it can if you pass a constant), it works, but when you pass it a variable it can't, so it requires you to specify that you mean the declared Foo::x variable which is available whether the template is constructed or not.
tl;dr tl;dr In the first example because Foo is passed a constant it's constructed(because the compiler is greedy and will do that if it can) and you're effectively dealing with a template instance, in the rest of your examples the template is passed an indeterminate variable and you're working with the template itself(which will only become an instance when I is determined).
Should I just use Common Lisp?
instead of Foo::x you could also just do this->x
>sepples: the absolute state
Finland is looking for tech jobs and has 100k positions right now. Should I move to ebinland from California?
Yes
But I want my binaries to be less than 60mb.
Isn't this fixing the issue well enough? It seems like you already knew about it and were waiting to post that.
Use ECL
If you're implying I'm a cpplet, I try to know enough about sepples to figure out source code but that doesn't mean I like it.
Do you think that some day C is going to be forgotten?
if you count everybody being dead as being forgotten, then mos def.
100k positions that do what exactly?
>scheme-fags are ok with static scoping
p-please post sauce
you can use "this->x", or if you want to enable the use of just x (unqualified) class/struct-wide, you can add "using Foo::x;" at the start of Baz
>implying
I use thunks and fluid let for all my code.
I am using pycharm with anaconda. when I try to see the quick documentation of a function, it shows only the prototype of the function, not the description or anything else. is there any way to fix this?
visual studio shows the description of the function and its parameters, when available.
Probably codemonkey shit, IT, and webdev codemonkey shit. A lot of it has to do with education because finns place massive amounts of trust in high quality education
>scheme-fags are ok with symbols having only one value cell for both functions and variables
>scheme-fags are ok with R7RS
>scheme-fags are ok with R7RS
It seems to have been taken down. What happened to it?
In my actual code, I was going to use this to minimize boilerplate, so if I have to write that for every variable in the base class, I might as well come up with something completely different.
Oh well, thanks for the help guys.
I'm a fucking caveman that learned nothing in college and I need to make an HTTP POST request, where's a good place to start reading to learn about it
what's your use case? i might be able to recommend something
...
Google: http protocol
Google: REST API
Browser -> F12 -> Network
man curl
I thought R7RS was only partially completed?
no california is the best fucking place in the world
>all the fucking mexicans there
maybe northern california
not even close. it's only "okay" when you have lots of money and you could go somewhere else and live better with that money too
are you joking?