amarao: (Default)
[personal profile] amarao
Вот, я опять узнал что-то новое.

! command позволяет инвертировать код возврата. Казалось бы, тривиально, но с учётом мнения readline по поводу '!' у меня было табу насчёт восклицательных знаков в шелле.

Date: 2022-05-01 03:18 pm (UTC)
From: [personal profile] ex0_planet
Yep, it is more complicated than I thought it would be.

Compiled? Not necessarily, IMO they have some sort of expression context (kinda like Perl, after all it is from the same era :)). So, a '! ! 42' evaluates in some sort of numeric context (there is an implicit assignment to $!); in the context of 'if .. then' expression it is evaluated as boolean. Makes sense, huh!?

Date: 2022-05-01 06:35 pm (UTC)
juan_gandhi: (Default)
From: [personal profile] juan_gandhi

Yes, but one had to reduce ! ! to nop, otherwise how does it know that ! 0 should be 42?

Profile

amarao: (Default)
amarao

May 2026

S M T W T F S
     12
3 4 567 89
101112 13141516
17181920 2122 23
242526 27 2829 30
31      

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated May. 31st, 2026 03:33 am
Powered by Dreamwidth Studios