conditional-expressions Questions

7

Solved

Just for curiosity/convenience: C# provides two cool conditional expression features I know of: string trimmed = (input == null) ? null : input.Trim(); and string trimmed = (input ?? "").Trim()...
Bartolommeo asked 22/11, 2010 at 10:2

1

Solved

I had this: msg = time + b' - ' + Logger.LEVELS_WORD[msg_loglevel] + b': ' + msg.encode('utf-8') + b'\n' Since sometimes msg was already bytes, I wanted to concat msg.encode('utf-8') if it was s...
Selfdeprecating asked 22/4, 2016 at 13:54

3

Solved

Noticed a line in our codebase today which I thought surely would have failed the build with syntax error, but tests were passing so apparently it was actually valid python (in both 2.x and 3). W...
Earley asked 2/6, 2014 at 15:22

2

Solved

I know you can use if statements like the following in makefiles: foo: $(objects) ifeq ($(CC),gcc) $(CC) -o foo $(objects) $(libs_for_gcc) else $(CC) -o foo $(objects) $(normal_libs) endif Is...
Unwary asked 31/7, 2013 at 20:8

3

Solved

Consider the following snippet: requires designide, rtl, vcl, {$IF RTLVersion < 19.0} // E2026 Constant expression expected //{$IF CompilerVersion = 22.0} // same as above vcljpg; {$ELSE...
1

© 2022 - 2024 — McMap. All rights reserved.