« first day (417 days earlier)      last day (4539 days later) » 

8:00 PM
@EtiennedeMartel Awesome :O
 
@CatPlusPlus why do you say that? Why is GameDev++ ugly?
 
@CaptainGiraffe Managed C++ is old .NET language, not even MS used that.
 
Xeo
> This is a follow up to my previous answer and contains C++0x related stuffs..
@cpx On your first link
 
user379888
@RichardPennington: We don't have hardware development here in my country. So we learn C++ by building managements systems :(
 
8:01 PM
@Akito what country is that?
 
@CatPlusPlus I ment to say as ugly as ...
 
@Yokhen Because it sacrifices safety for raw performance, driven mostly by myths. (And in case sarcasm wasn't obvious, there's no GameDev++.)
 
cpx
@Xeo Oh I see.
 
Games are about the only place left where performance matters and where you can't bypass it by throwing more hardware at the problem.
 
user379888
@Yokhen: Pakistan, we dont have hardware development here. I should switch to China :p
 
8:02 PM
You certainly can throw more GPUs at it.
 
@EtiennedeMartel :O I see
 
@EtiennedeMartel not really
 
user379888
@Yokhen: I may start web development if I plan staying here.
 
Game developers are just primadonnas who think they're special and that their problems are unique and that there's nothing they can learn from other developers
 
@CatPlusPlus What about consoles?
 
8:03 PM
@Akito What you are really saing is that management systems are all that is requested in your countty?
 
@Akito I have a few friends from pakistan. They love their country :P
 
I don't have any experience with AAA code, obviously, but I have a feeling it's mostly myths and job security more than anything else.
@EtiennedeMartel They suck.
 
You have to make a game that looks better than the competitor's, yet runs on the same 6 year old hardware.
 
You can be PC-exclusive and live.
 
@jalf Thats an experience I would not care for. Care to elaborate?
 
8:04 PM
@CatPlusPlus Consoles are a huge market.
 
user379888
@Yokhen: I love my country too. It was just that I pointed that we dont have development here. Not my countries fault but the worlds fault that they dont make Xbox or PS here.
 
there are plenty of programming fields where you have to squeeze maximum performance out of your hardware
 
I never saw anything compelling in consoles.
 
@CatPlusPlus But it's not as much fun.
 
0
A: C String Concatenation

NilsAs people pointed out string handling improved much. So you may want to learn how to use the C++ string library instead of C-style strings. However here is my solution in pure C #include <string.h> #include <stdio.h> void someFunc (char* s1) { char* s2; s2 = "hello "; ...

so here is my sln
 
8:05 PM
@Nils Buggy.
 
@Akito Awww :( Someone should contact Microsoft and make a branch over there!
 
Buffer overrun.
 
@CatPlusPlus I only had a quick look at the Doom3 code, but so far it looks pretty impressive.
 
Never assign string literal to char*.
 
@jalf Not many. And most of the time, just use more servers.
 
user379888
8:06 PM
@CaptainGiraffe: No, I mean due to lack of hardware development, they teach C++ also by software development examples.
 
@CatPlusPlus char* p = 0;
 
@awoodland Hi!
@AndrewCecil Hi!
 
@RMartinhoFernandes where exactly?
 
@cHao What up!
 
user379888
@Yokhen: Well Microsoft is here. We have a plenty of .Net developers here.
 
8:06 PM
@CaptainGiraffe 0 is not a string literal.
 
@Akito so why isn't there a hardware branch?
 
sup.
 
@RMartinhoFernandes I tried ok?!
 
@Nils There's only one buffer, so...
 
@CatPlusPlus why not?
 
8:07 PM
String literals are readonly.
 
@CharlieSanders Hey yo!
 
user379888
@Yokhen: That I don't know but they only make softwares here.
 
Oh.... :(
@surfasb Sup!
 
@RMartinhoFernandes so then there is an implicit cast, casting the const away if I do char *a = "adsf" ?
@RMartinhoFernandes Yes, but I get the size with strlen
 
@Nils Probably for historical reasons. It should always be a const char *.
 
8:09 PM
@Nils The doom sqrt function is a classic, I'm surprised Donald didnt analyse it to pieces in his last addendum to TAoCP.
 
GCC warns with "deprecated assignment of string literal to char*".
 
@Yokhen hi
 
@CaptainGiraffe Donald?
 
char const str[6] = "hello";
assert(strlen(str) == 5);
 
C used to not have const.
 
8:09 PM
@EtiennedeMartel thx
 
@Nils Knuth.
 
@Nils Donald Knuth our guru our leader our hero.
 
@CatPlusPlus that was K&R C though right - ANSI C added it in 1989?
 
Xeo
Ugh. I told you about my littlest brother (2yrs) pulling the plug on my system some time ago, right?
 
@CatPlusPlus but C89 does, right?
 
@CatPlusPlus :)
 
Xeo
Now my little brother (13yrs) pulled the plug on the router -.-
 
@awoodland Yeah.
 
@Nils Never use strcpy.
 
sbi
@Nils You call strlen(s1) twice, disregard const, rely on a C99 feature that not even all compilers might support, and forgot the trailing '\0'.
 
8:10 PM
yes it is strNcpy
 
@MatveyBAksenov Why not?
 
@sbi: I just tried to upvote that :(
 
sbi
@MatveyBAksenov Since he made sure the buffer is big enough beforehand, I see no problem in that.
 
There's much K&R in ANSI C, like old prototypes.
 
because it says: "int x(); could be parsed as a default initialized variable of type int". and it says "Now in C++ there is a rule that if something can be parsed both as a declaration and as a definition, it will be parsed as a declaration. That is, in this case the first interpretation will be used.". I'm voting it down for these wrong statements.
 
Xeo
8:11 PM
@JohannesSchaublitb Why say that in chat and not in a comment?
 
@sbi: but he did it wrong. The buffer is too small
 
He's rallying pitchfork brigade, can't you tell? :P
 
Hey guys, do you know of any vector structure similar to the one in C++, but for C?
 
@JohannesSchaublitb Do you have the proper refs?
 
because this way it feels better
 
Xeo
8:12 PM
@CaptainGiraffe He is the proper ref.
 
@ManofOneWay GLib probably has something.
 
Xeo
He's like the walking C++ standard in here.
5
 
@ManofOneWay: typedef struct { void* data; int len; } vector;
 
It's ugly, but hey, it's C.
 
sbi
@MooingDuck If he uses the wrong length, he would pass the same wrong length to strncpy(), no?
 
8:12 PM
@sbi yes I agree
so how to fix it for c89?
 
@CatPlusPlus Btw, did you tell me how the exam went?
 
Also we all here love Johannes, and regard him as a proxy to the normative docs
 
im the walking wanna be lawyer :(
 
@sbi: he would probably pass totalLenght, which would prevent the overrun at least.
 
sbi
@Nils To what?
 
8:12 PM
@ManofOneWay Like immediately after you asked. :> 21/40
Great success.
 
sbi
@MooingDuck And leave a string without '\0'?
 
@CatPlusPlus What's the mean?
 
THAT CODE USES STRNCAT, PEOPLE.
 
" Since function declarations never start with auto, this would have forced the compiler to interpret it as variable definition. " not true either
 
8:13 PM
@Nils Variable length arrays are not C89 btw.
 
oh my GODD!
 
@sbi: that's safer than writing past the end every time.
 
WTF did I write?
 
Also it's "length" not "lenght".
 
what is VLA then @RMartinhoFernandes?
 
8:14 PM
@MooingDuck It will just run past the end at the first use.
@Nils Sorry, I got that garbled.
58 secs ago, by R. Martinho Fernandes
@Nils Variable length arrays are not C89 btw.
 
There is nothing wrong with strcpy or strcat! Just realize what they are doing!
 
Also, @MooingDuck, <string.h> is not C++ style.
C has <> and "" distinction, too.
 
@RMartinhoFernandes: I just realized that you all probably think I'm defending strcat. That was not my intent, strncat is better.
@CatPlusPlus: I didn't know that
 
@CaptainGiraffe It's like saying "there's is nothing wrong with a high-powered rifle, just don't shoot yourself in the foot!". Thanks, but I'd prefer not to have to handle the fucking rifle in the first place.
 
The code has no overrun, only truncation problem.
 
8:15 PM
@EtiennedeMartel exactly
 
It will lack finishing \0 as far as I can see.
For C89 you need to malloc the destination array.
 
@CatPlusPlus it doesn't? I... oh. I thought he had a strcat this whole time instead of strncat. Don't I feel silly.
 
@EtiennedeMartel Ok so do we forbid for-loops that are not of the for( i : stuffs) kind?
 
@RMartinhoFernandes yeah I know that, just overlooked it and compiler did not complain because I forgot -std=c89
 
@CaptainGiraffe In C++11, it's possible to only use that form.
 
8:17 PM
There is everything wrong with strcpy and strcat.
 
@CatPlusPlus The opposite of your statement is true.
 
Nope.
 
The thing is, I already have enough stuff do deal with as a programmer, I don't want to also have to compensate for the deficiencies of the standard library.
 
Everyone in C world agrees that you should never use them.
 
Lets prove the correctness of strcpy, just as a for instance.
 
8:19 PM
@sbi This time he could be lucky.
 
May I ask something off-topic?
 
@CaptainGiraffe It does not check its bounds. That's a problem right there.
 
Is "a for instance" a British or American idiom?
 
@EtiennedeMartel And thats the only problem.
 
@CaptainGiraffe That's a serious problem.
"Oh, the only problem with this car is that it can sometimes explode. But it's the only one!"
 
8:20 PM
@RMartinhoFernandes I quite like to use it. I'm a Swede that learned English, and got some proficiency in the US.
 
I've never heard it before. It's just "xxx, for instance" or "for instance, xxx". Whether it's BrE, AmE or common, dunno.
 
@EtiennedeMartel It explodes if you run out of gas....
 
@nil or @DeadMG will know.
 
@RMartinhoFernandes Why did you add s3[totalLength-1] = 0; ?
 
@RMartinhoFernandes: It should be s3[totalLength] = 0; and totalLength + 1 as size of VLA.
 
8:22 PM
string s; //your arguments are moot
 
When I want to concat two strings, I use std::string::operator+=.
 
@Nils The string needs to be null-terminated.
 
When I want to concat two strings, I slam my keyboard with a hammer.
 
0.8 seconds @Etienne =)
 
8:23 PM
@CatPlusPlus Tried that I wasn't in insert mode
 
@RMartinhoFernandes: Otherwise you're losing last character of second string.
 
@RMartinhoFernandes yes but I thought strncat adds null termination
 
Oh wait, you've changed totalLength, too. Cheater!
Disregard that, then.
 
At least that is what my man page tells me:
" The strncat() function appends not more than n characters from s2, and then adds a ter-
minating `\0'."
 
8:24 PM
@RMartinhoFernandes I think "a for instance" as in "can you give me a for instance?" is an en_US thing
 
@Nils Paranoia. I didn't feel like checking the docs :) Feel free to remove it then.
 
Though I think it might be clearer with totalLength = len a + len b;.
 
soo
 
@awoodland Why would you possibly write en_US as in a country code?
 
55 mins ago, by R. Martinho Fernandes
I wanted to reach the repcap today, but I took an arrow to the knee. I'm going to sleep now. See you tomorrow.
 
8:25 PM
I am still not happy with it
 
@awoodland Ah, thought so.
 
But seriously, get rid of that assigning string literals to char* thing.
@RMartinhoFernandes You can never leave.
 
I'm still awake. Damn this chat.
 
lol
 
@CaptainGiraffe not as a country code, as a language code: debian.org/international/l10n/po/en_US
 
8:27 PM
@awoodland my bad
What would the british say?
 
"an example".
 
"Frankly, dear, I dont give a damn"?
 
*my dear
 
Indubitably.
 
@RMartinhoFernandes not the same
 
8:29 PM
I think it's mostly "e.g." in text and "for example" in spoken.
 
@Nils Incorporate Cat's suggestions. Gets more readable. Use malloc if you want to stick with C89. Don't forget free.
 
Asking for a particular piece of contradictory evidence. An example just does not cut it.
 
@CaptainGiraffe How's not the same?
"Can you give me a for instance?" vs "Can you give me an example?"
 
@CaptainGiraffe I'd just say "can you give me an example"
 
8:29 PM
"For instance" and "for example" are equivalent.
 
Thank you, I have just been disproven.
 
@RMartinhoFernandes Yes that's what I wanted to point out. You either have to use malloc or you end up with something like this: codepad.org/NDP6dxHl
 
@Nils No not that. That's code from 1988.
 
@CatPlusPlus ok what to do then with the string literals?
 
0
A: Composition between abstract classes

parapura rajkumarIn a way you can achieve this by having a reference class A { virtual ~A() = 0; }; class B { virtual ~B() = 0; A& mA; }; class C { virtual ~C() = 0; std::shared_ptr<A> mA; }; Both A, B and C are abstract classes and B,C have an has-a relation wrt A

I don't think giving reference data members to newbies is a good idea.
 
8:31 PM
lol
 
I'm trying to find the simplest yet clear implementation of the towers of hanoi in c++. Do you have anything in your back pocket?
 
Yes I am looking at you Johannes!
 
Ok, now is for real. Good night.
 
8:34 PM
@RMartinhoFernandes sleep tight
 
today someone who has diabetics had an incident
 
@JohannesSchaublitb lol
 
I really wish when MSVC hit a stack overflow it would tell you what it was compiling in more detail. It just tells me: see reference to class template instantiation X, where X is (as far as I can find) not recursive.
 
@JohannesSchaublitb Mom suffers from that in a deadly manner
 
in the train... speakers said "please someone with medical experience come to the front something happened..." and then people were asked to bring sweet drinks and stuffs to the front
 
8:35 PM
@CaptainGiraffe what are you looking for for an "implementation"? The algorithm is trivial, but what should an "implementation" do?
 
the worst thing is, the train had to wait 2hours on the track because the driving machine was defective...
 
@MooingDuck clear tidy variabels, recursive
 
sucks big times lol
 
@JohannesSchaublitb sounds like a diabetic then
 
8:36 PM
Diabeetus.
 
Xeo
hm. @Johannes, do you know if clang is buggy on reference overloading of member functions? e.g. void foo() &; for lvalue refs only
 
@CatPlusPlus thank you
looks good
 
@JohannesSchaublitb Sounds like mom
 
@Xeo dunno i thought it works
hmmm
 
Xeo
Either I'm doing something wrong or this example shouldn't compile:
template<class T>
struct value_types{
  T& lvalue() &{ return static_cast<T&>(*this); }
  T const& lvalue() const&{ return static_cast<T const&>(*this); }
  T const& clvalue() const&{ return lvalue(); }

  T&& rvalue(){ return static_cast<T&&>(*this); }
  T const&& rvalue() const{ return static_cast<T const&&>(*this); }
  T const&& crvalue() const{ return rvalue(); }
};

struct foo
  : value_types<foo>
{
};

int main(){
  foo().rvalue().lvalue();
};
 
8:38 PM
Crap the engineers of this world are useless
 
Dispenser comin' up!
 
@CaptainGiraffe Yes, and they can't hold their liquor.
 
@EtiennedeMartel Mom does a proper job at that still 10 years in to diabetes.
 
@CaptainGiraffe ideone.com/yo0Hq
 
@MooingDuck Sweet =) I just have to change the main a small tad =) but its great
 
8:41 PM
This is probably commonly known, but how do you fill a vector with values read from an istream with istream_iterator
 
@Xeo: foo().rvalue() returns a foo&&, which has a lvalue() member. I see no problem. Why shouldn't it compile?
 
Seems like I've seen it before
 
I just introduced global variables for them.
 
@SethCarnegie std::copy(std::istream_iterator(stream), std::istream_iterator(), std::back_inserter(vec));
 
vector<int> a; a.assign(istream_iterator<int>(cin), istream_iterator<int>());
 
8:42 PM
IIRC.
 
@EtiennedeMartel ahhh yes, back_inserter was what I was missing, thanks very much
 
Xeo
@SethCarnegie std::copy(std::istream_iterator<T>(std::cin), std::istream_iterator(), std::back_inserter(the_vec));
damn, all being faster than me :(
 
yeah, thanks
 
@Xeo I was soooo much faster.
 
@MooingDuck ah, that's also a cool way of doing it
is there any reason to choose one or the other
 
8:43 PM
Mine clears pre-existing data, theirs doesn't
 
@CatPlusPlus My new version stackoverflow.com/a/8421784/44232
 
Xeo
@MooingDuck Yes, but lvalue is overloaded to only be callable on lvalue references (the & at the end), meaning you shouldn't be able to get an lvalue back from an rvalue.
 
Oh I see
 
@Xeo a const lvalue ref can bind to a prvalue and xvalue
i'm in the impression that a "const&" can be called for rvalues
 
@MooingDuck That is for sure one of the most elegant variants I have ever seen!
 
8:44 PM
@Xeo I didn't see the & at the end, and I've never heard of such a thing. Huh
 
Xeo
Ugh, right. Typical T const& ref = temporary(); thing, eh?
 
but i haven't checked the spec
@Xeo i would assume they made it like that yes
 
Xeo
Hm. Any idea on how to make ?lvalue only callable from lvalues?
 
but if you now overload the lvalue with "&&", the "&&" would take precedence
 
@CaptainGiraffe: Really? It's not a complicated puzzle
 
8:45 PM
Would it be confusing if a language did this:
 
@Xeo if you only have a "&" then it is only callable for lvalues
 
    a = 1

    if (a) {
        print(a) // prints 1
        a = 10
        print(a) // prints 10
    }

    print(a) // prints 1
 
Yes, it would. Terribly.
 
Xeo
Oh wait, that wouldn't make any sense too, because I wanted lvalue to be callable on temporaries (the use case I had in mind was stringstream().flush() << "blah"; where you need to call flush to get an lvalue ref to get the non-member operator<< overload selected. Luckily, this is fixed with C++11).
 
@Xeo having it return a "const T&" for rvalues seems fine
if you still want to forbid it, you can overload it for "&&" and "= delete" that overload
 
Xeo
8:48 PM
@JohannesSchaublitb Good call. Still, my whole idea just went to the bin since all library provided operator<< overloads are now callable from temporaries...
 
What about:

    for (;;) {
        print(a) // prints None
        a = 10
        print(a) // prints 10
        break
    }

    print(a) // prints None
 
Xeo
I just wonder if that means increased complexity to define user-provied operator<< overloads
Now you'd need two to handle temporaries too.
 
iirc "stringstream() << "hello" will not work in c++11
 
In that one, there is no previously existing a
 
8:49 PM
it uses to work in some drafts, during the time that "&&" could directly bind to lvalues
 
Xeo
@JohannesSchaublitb It should from what I gathered
gimme a sec
 
but after they changed that, it didn't work anymore, because they changed all the "&&" to "&" again, making them reject rvalues. and having overloads for "&&" for all the output operators just for support writing into an rvalue seems a bit too much
but perhaps i misremember
 
cpx
hm
 
Xeo
Any hints where the overloads are specified in the standard?
 
the one for string is specified in basic_string IIRC
 
Xeo
8:56 PM
// 21.4.8.9, inserters and extractors:
template<class charT, class traits, class Allocator>
    basic_istream<charT,traits>&
    operator>>(basic_istream<charT,traits>&& is,
        basic_string<charT,traits,Allocator>& str);
template<class charT, class traits, class Allocator>
    basic_ostream<charT, traits>&
    operator<<(basic_ostream<charT, traits>&& os,
        const basic_string<charT,traits,Allocator>& str);
for string
atleast there are those rvalue overloads
 
Xeo
no non-rvalue overloads though
strangely
 
so i'm all wrong
wait that would be weird xD
 
Xeo
lol
FDIS still has lvalue ref in 21.4.8.9 though
template<class charT, class traits, class Allocator>
    basic_istream<charT,traits>&
    operator>>(basic_istream<charT,traits>& is,
        basic_string<charT,traits,Allocator>& str);
1 Effects: Behaves as a formatted input function (27.7.2.2.1).
Seems weird, I hope that was fixed for final standard oO
 
hmm FDIS does not have the operator>> for rvalue refs
just those for lvalue refs
but it has std::getline for rvalue ref
 
Xeo
9:01 PM
@JohannesSchaublitb It has it in the synopsis, but not in the actual paragraph
 
that seems like a bug
i will notify Daniel Kruegler about it. he sure knows what to do xD
 
Xeo
ahh
§27.7.2.6 Rvalue stream extraction
template <class charT, class traits, class T>
    basic_istream<charT, traits>&
    operator>>(basic_istream<charT, traits>&& is, T& x);
1 Effects: is >> x
2 Returns: is
same for ostream under §27.7.3.9
 
aha interesting
 
Xeo
still a bug in FDIS that basic_string synopsis shows rvalue overloads and actual paragraphs show lvalue overloads I believe
 
so the synopsis of basic_string should prolly only include the lvalue version instead of the rvalue version
i'm still all wrong xD
 
Xeo
9:07 PM
@JohannesSchaublitb What do you mean?
 
so we actually can do stringstream("lulz") >> str;
 
Xeo
yeah
that's cool for logging without defining a logger, with only an "iosmanip" function sending the string in the stream to the file
stringstream() << "hi" << var << "foo" << endlog;
 
Xeo
without that stupid std::stringstream().flush()
just to get that lvalue
 
Xeo
9:11 PM
9
Q: std::ostringstream printing the address of the c-string instead of its content

Matthieu M.I have stumbled on a weird behavior that I just could not explain at first (see ideone): #include <iostream> #include <sstream> #include <string> int main() { std::cout << "Reference : " << (void const*)"some data" << "\n"; st...

 
cpx
@Xeo bronze badge to OP
 
@Xeo not so sure whether static_cast suffices
because basic_istream has a virtual base class. there was a pitfall where you cannot use static_cast when a virtual base class is involved
@Xeo ahh i see now @alf's answer is enlightening
@Xeo ah it would only fail if a virtual base class is between the source and destination of the cast
 
Xeo
virtual bases make my head hurt :(
omg. MSVC10
template<class _Traits> inline
	basic_ostream<char, _Traits>& operator<<(
		basic_ostream<char, _Traits>& _Ostr, unsigned char _Ch)
	{	// insert an unsigned char
	return (_Ostr << (char)_Ch);
	}
 
Can you check whether a type has specific non-static member function with a type trait?
 
Xeo
9:21 PM
Now I want to test if that actually prints any unsigned char over 128
 
Or, hm. Can copy/move constructor be disabled with SFINAE?
 
Xeo
@CatPlusPlus They can be = deleted :)
But ofcourse they can
The standard explicitly allows further parameters after the first (the class type), so long they are defaulted
 
Okay, lemme try.
Ooh, I got beta key for Tribes: Ascend.
 
Xeo
I thought you had that exact standard quote in your head. :P
 
Yeah, but I wonder how that'd look.
 
Xeo
9:25 PM
sfinae after the class type
 
struct foo {
    foo(const foo&, std::enable_if<...>::type* = nullptr);
private:
    foo(const foo&);
};
Something like that?
 
Xeo
@CatPlusPlus no private foo(foo const&)
how would that work? they both have one argument that is not defaulted, they define the same function really
 
Oh, it won't generate default one if that one is disabled?
 
Xeo
foo(const foo&, std::enable_if<...>::type* = nullptr); is a valid copy constructor
 
I know that. I don't know how it behaves when it's not enabled. :P
 
Xeo
9:27 PM
It's there, it's just removed from the overload set
it's not like it suddenly starts generating functions during overload resolution :P
except for instantiating templates I guess
When dealing with stuff like this, one realy learns how complicated C++ is
Anyways, I'm awake for more than 24h already and I pulled an allnighter before those 7h of sleep I had yesterday, so I'm gonna excuse myself for today
 
good night Xeo
 
Xeo
See ya tomorrow
Also, @Johannes, please find a solution to this :(
/off
 
> Downloading Tribes Ascend Closed Beta
Harharhar.
 
Is ++ doubleplus?
If so is ++(good) or (bad)++ valid statements?
 
9:43 PM
@CaptainGiraffe: One calls good::operator++() and the other calls bad::operator++(int). Both are valid.
 
You've missed the reference.
 
cpx
@CaptainGiraffe just, plus plus
 
wonder if struct foo{ void bar() = delete; } is valid?
 
cpx
as in C plus plus
wonder why its not plus plus C
 
@MooingDuck I think it'd be valid if there were base class defining it.
And you've both missed the reference. 1984, people.
 
9:45 PM
@CPx: because that's just awkward
"doubleplus"? only kinda sounds like 1984, but doesn't seem to quite be doublespeak.
 
Doubleplusgood.
 
cpx and Mooing, stand by your telescreen for Thought examination, brought to you by the Ministry of Love.
@MooingDuck newspeak
 
Does anyone know off the top of their head of a Python construct besides functions that create a new scope
 
classes?
 
class. Other than that, none.
 
9:49 PM
Is that the reason python uses tabs?
 
i guess lambdas could too, though i'd count them as functions
 
/tab new scope would be ridiculous
 
@CaptainGiraffe: pft, Newspeak is an instance of doublespeak. en.wikipedia.org/wiki/Doublespeak even has en.wikipedia.org/wiki/Newspeak as a see-also
 
Wow that sucks, so neither while nor for nor if or anything makes a new scope?
They're just lazily dodging the problem I'm trying to solve :(
 
@MooingDuck I thought we were in lit::orwell::1984::
 
9:52 PM
@cHao No, you can't have statements in lambdas.
So you can't introduce new binding.
(Modifying locals() is forbidden).
@SethCarnegie Nope.
 
I just wrote a CV, and I couldn't decide if I liked c++ more than scheme or c#
I finally decided upon writing that I liked c++ the most.
 
> A block is a piece of Python program text that is executed as a unit. The following are blocks: a module, a function body, and a class definition.
> A scope defines the visibility of a name within a block. If a local variable is defined in a block, its scope includes that block. If the definition occurs in a function block, the scope extends to any blocks contained within the defining one, unless a contained block introduces a different binding for the name.
 
@CatPlusPlus Eric Lippert could have written that, its not anything dramatic
Well, he could have but he wouldn't have =)
 
@CatPlusPlus thanks
 

« first day (417 days earlier)      last day (4539 days later) »