January 21, 2012 Re: [OT] Programming language WATs | ||||
---|---|---|---|---|
| ||||
On Saturday, January 21, 2012 03:44:53 Andrej Mitrovic wrote:
> Probably Windows-only:
>
> void main()
> {
> string a = "foo";
> "foo" = "bar";
> writeln(a); // "foo"
> assert(a == "foo"); // failure
> }
Yeah. I don't understand why string literals aren't treated as fully immutable in Windows. They are in Linux. It makes no sense to be able to alter string literals.
- Jonathan M Davis
|
January 21, 2012 Re: [OT] Programming language WATs | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jonathan M Davis | "Jonathan M Davis" <jmdavisProg@gmx.com> wrote in message news:mailman.640.1327115503.16222.digitalmars-d@puremagic.com... > On Saturday, January 21, 2012 03:44:53 Andrej Mitrovic wrote: >> Probably Windows-only: >> >> void main() >> { >> string a = "foo"; >> "foo" = "bar"; >> writeln(a); // "foo" >> assert(a == "foo"); // failure >> } > > Yeah. I don't understand why string literals aren't treated as fully > immutable > in Windows. Or as rvalues. > They are in Linux. It makes no sense to be able to alter string literals. > |
January 21, 2012 Re: [OT] Programming language WATs | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nick Sabalausky | On Friday, January 20, 2012 22:14:43 Nick Sabalausky wrote:
> "Jonathan M Davis" <jmdavisProg@gmx.com> wrote in message news:mailman.640.1327115503.16222.digitalmars-d@puremagic.com...
>
> > On Saturday, January 21, 2012 03:44:53 Andrej Mitrovic wrote:
> >> Probably Windows-only:
> >>
> >> void main()
> >> {
> >>
> >> string a = "foo";
> >> "foo" = "bar";
> >> writeln(a); // "foo"
> >> assert(a == "foo"); // failure
> >>
> >> }
> >
> > Yeah. I don't understand why string literals aren't treated as fully
> > immutable
> > in Windows.
>
> Or as rvalues.
Yeah. String literals should definitely be immutable rvalues, and they should be that way _regardless_ of the OS or architecture.
- Jonathan M Davis
|
January 21, 2012 Re: [OT] Programming language WATs | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jonathan M Davis | On Saturday, 21 January 2012 at 03:18:43 UTC, Jonathan M Davis wrote:
> Yeah. String literals should definitely be immutable rvalues,
consider this though:
auto a = "hello";
a = "new";
If is("hello" == immutable(char[])), then a would
be too, and the rebinding would fail.
That'd be annoying.
|
January 21, 2012 Re: [OT] Programming language WATs | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jonathan M Davis | On 01/21/2012 04:17 AM, Jonathan M Davis wrote:
> On Friday, January 20, 2012 22:14:43 Nick Sabalausky wrote:
>> "Jonathan M Davis"<jmdavisProg@gmx.com> wrote in message
>> news:mailman.640.1327115503.16222.digitalmars-d@puremagic.com...
>>
>>> On Saturday, January 21, 2012 03:44:53 Andrej Mitrovic wrote:
>>>> Probably Windows-only:
>>>>
>>>> void main()
>>>> {
>>>>
>>>> string a = "foo";
>>>> "foo" = "bar";
>>>> writeln(a); // "foo"
>>>> assert(a == "foo"); // failure
>>>>
>>>> }
>>>
>>> Yeah. I don't understand why string literals aren't treated as fully
>>> immutable
>>> in Windows.
>>
>> Or as rvalues.
>
> Yeah. String literals should definitely be immutable rvalues, and they should
> be that way _regardless_ of the OS or architecture.
>
> - Jonathan M Davis
Tail immutable rvalue is fine. It would be annoying if they were immutable.
|
January 21, 2012 Re: [OT] [ot Programming language WATs | ||||
---|---|---|---|---|
| ||||
Posted in reply to Robert Clipsham | On Friday, 20 January 2012 at 15:40:44 UTC, Robert Clipsham wrote:
> Just came across this amusing 4 minute video:
>
> https://www.destroyallsoftware.com/talks/wat
>
> Anyone have any other WATs you can do in other languages? Bonus points for WATs you can do in D.
|
January 21, 2012 Re: [OT] destroy all software (was Programming language WATs) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Robert Clipsham | On Friday, 20 January 2012 at 15:40:44 UTC, Robert Clipsham wrote:
> https://www.destroyallsoftware.com/talks/wat
Curious: anyone here checked out the author's screencasts?
I found this video amusing so I looked at the others,
but he wants money for it.
Worth the ten bucks?
|
January 21, 2012 Re: [OT] Programming language WATs | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | On Saturday, January 21, 2012 04:20:36 Adam D. Ruppe wrote:
> On Saturday, 21 January 2012 at 03:18:43 UTC, Jonathan M Davis
>
> wrote:
> > Yeah. String literals should definitely be immutable rvalues,
>
> consider this though:
>
> auto a = "hello";
> a = "new";
>
> If is("hello" == immutable(char[])), then a would
> be too, and the rebinding would fail.
>
> That'd be annoying.
Well, when it was changed so that IFTI treated arrays as tail-const, dsimcha proposed that we do the same with auto. If we did that, then it solves the problem.
- Jonathan M Davis
|
January 21, 2012 Re: [OT] destroy all software (was Programming language WATs) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | On Fri, Jan 20, 2012 at 9:28 PM, Adam D. Ruppe <destructionator@gmail.com> wrote: > On Friday, 20 January 2012 at 15:40:44 UTC, Robert Clipsham wrote: >> >> https://www.destroyallsoftware.com/talks/wat > > > > Curious: anyone here checked out the author's screencasts? > > I found this video amusing so I looked at the others, > but he wants money for it. > > Worth the ten bucks? > > You could watch this for free, but it's not amusing. I know, I just graduated. http://www.youtube.com/watch?v=VpZtX32sKVE |
January 21, 2012 Re: [OT] destroy all software (was Programming language WATs) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Caligo | On Saturday, 21 January 2012 at 03:43:50 UTC, Caligo wrote:
> http://www.youtube.com/watch?v=VpZtX32sKVE
Oh my, don't get me started on college!
I'm so happy I dropped out of that waste.
|
Copyright © 1999-2021 by the D Language Foundation