Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.forth Subject: Re: Object-Oriented Programming is Bad Date: Wed, 07 Dec 2016 09:26:17 -0800 Organization: A noiseless patient Spider Lines: 18 Message-ID: <87mvg7647a.fsf@nightsong.com> References: <4ca00d44-3973-4ddc-8572-6616882b0252@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="74e79c0f0540a6f5c782381fbe1f6bec"; logging-data="4579"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19rwq1aw5RIbcMle+DaLfOm" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:FB1oiTSbp8Xz2PFYYkf995+3eBk= sha1:DYAr+k304p2zlYv7aJ5XTFDvb1Q= Xref: csiph.com comp.lang.forth:53164 Julian Fondren writes: > the feature he wants at the end, which he doesn't think any existing > language has, is actually what quotations are. Non-Hugh quotations: he > explicitly doesn't want any of the outer function's environment to > seep through into the inner function, except by argument passing. I skipped to the end and I think C++11 lambdas is basically what he wants. If you want a lambda to capture variables from its enclosing scope, you have to name them explicitly, like: int x; auto foo = [x]() { return x+3; } (I may have the syntax slightly wrong but that's the idea). The video looks interesting but I don't have the patience to sit through 45 minutes of it. I wonder if he has a blog post or something somewhere..