Nim,A new approach to meta programming':', ' ', $obj.b, '\n')) result.add(`&`("s", ':', ' ', $obj.s, '\n')) result.add(")") After constant folding: result = "(" result.add(`&`("a: ", $obj.a, '\n')) result.add(`&`("b: ", $obj.b, '\n')) result Optimizing Hello World (4) Copyright © 2013 Andreas Rumpf Optimizing Hello World (4) After constant folding: result = "(" result.add(`&`("a: ", $obj.a, '\n')) result.add(`&`("b: ", $obj.b, '\n')) result `&`("b: ", $obj.b, '\n')) & `&`("s: ", $obj.s, '\n')) & ")" After constant folding (that the compiler performs for us) it becomes: result = `&`("(a: ", $obj.a, "\nb: ", $obj0 码力 | 45 页 | 360.68 KB | 1 年前3
Nim 2.0.8 Manualthe end-user to one/some of the other players, but the total amount seems to remain pretty much constant for a given task. -- Ran T A t A About this document Note: This document is a draft! Several compiled into the executable. However, some code may be executed at compile-time. This can include constant expressions, macro de�nitions, and Nim procedures used by macro de�nitions. Most of the Nim language disabled. A constant expression is an expression whose value can be computed during a semantic analysis of the code in which it appears. It is never an l-value and never has side effects. Constant expressions0 码力 | 132 页 | 5.73 MB | 1 年前3
Programmer’s Guide for Free Pascal, Version 3.2.2minimum enumeration size . . . . . . . . . . . . 32 1.2.52 $MINFPCONSTPREC : Specify floating point constant precision . . . . . . . 32 1.2.53 $MMX : Intel MMX support (Intel 80x86 only) . . . . . . . . . . . . . . . . . . . . . . . . . . 129 11.1.1 Constant folding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 11.1.2 Constant merging . . . . . . . . . . . . . . . . . . . . . 1.3 Short cut evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 11.1.4 Constant set inlining . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 11.1.5 Small sets0 码力 | 187 页 | 531.58 KB | 1 年前3
The Go frontend for GCCthe program—a list of state- ments. • Named_object. A named object: a function, variable, type, constant, or package. Each of these structures is a class in gccgo’s source code. The Statement, Expression implementation to restrict the size). They only acquire a type when they are used out- side of a constant expression, e.g., in an assignment. At the point of use, the value of the expression must fit in results after recovering from a panic. • Gccgo converts switch statements with cases that are not constant or whose switch variable does not have integer type to a series of if statements. • Gccgo converts0 码力 | 14 页 | 122.25 KB | 1 年前3
⽤ egg 孵化你的 SQL 优化器 - 王润基(/ (* a 2) 2) => a Analysis Some(1) Some(2) None None None Constant Analysis Analysis Some(1) Some(2) None None Constant Folding Some(3) None Some(6) Some(3) 3 SELECT name, url FROM t1 JOIN0 码力 | 39 页 | 6.48 MB | 1 年前3
C++23: An Overview of Almost All New and Updated Featuresis evaluated during constant evaluation, then A is executed, otherwise B14 if consteval Why? We have std::is_constant_evaluated(), so what’s wrong with: if (std::is_constant_evaluated()) { /*A*/ which you cannot do in /*A*/ above if consteval cannot be used wrong is_constant_evaluated() can: if constexpr (std::is_constant_evaluated()) { /*A*/ } else { /*B*/ }15 if consteval Example: consteval std::println("{}", std::ranges::contains_subrange(v1, v2)); // true75 Changes to Ranges Library Several folding algorithms: ranges::fold_left(), fold_left_first(), fold_right(), fold_right_last(), fold_left_with_iter()0 码力 | 105 页 | 759.96 KB | 6 月前3
Is std::mdspan a Zero-overhead Abstraction? - Oleksandr Bakirov - CppCongenerating identical assembly for different color spaces, without relying on non-standard Identical Code Folding. ● It allows to formulate in-place color conversions, for example, from RGB to BGR. ● Good as std::integral_constant{}}; 14 } 15 }; 71RGB to Grayscale conversion 72Color spaces 1 struct RGB {}; 2 3 auto channelCount(RGB) { 4 return std::integral_constant {}; 6 7 struct Grayscale {}; 8 9 auto channelCount(Grayscale) { 10 return std::integral_constant {}; 11 } 73Conversion using mdspan (draft) 1 void convertColorSpace( 2 mdspan 0 码力 | 75 页 | 1.04 MB | 6 月前3
Golang Manual By AstaXie-20120522identifier (which includes words like int and float64), a basic literal such as a number or string constant, or one of the tokens break continue fallthrough return ++ -- ) } the lexer always inserts a semicolon initialized objects in different packages are handled correctly. Constants Constants in Go are just that—constant. They are created at compile time, even when defined as locals in functions, and can only be numbers compile-time restriction, the expressions that define them must be constant expressions, evaluatable by the compiler. For instance, 1<<3 is a constant expression, while math.Sin(math.Pi/4) is not because the function0 码力 | 6205 页 | 12.83 MB | 1 年前3
Jinja2 Documentation Release 2.10all expressions. Node type Node as_const(eval_ctx=None) Return the value of the expression as constant or raise Impossible if this was not possible. An EvalContext can be provided, if none is given jinja2.nodes.Literal Baseclass for literals. Node type Expr class jinja2.nodes.Const(value) All constant values. The parser will return this node for simple constants such as 42 or "foo" but it can be Any list literal such as [1, 2, 3] Node type Literal class jinja2.nodes.TemplateData(data) A constant template string. Node type Literal class jinja2.nodes.Tuple(items, ctx) For loop unpacking and0 码力 | 148 页 | 475.08 KB | 1 年前3
julia 1.10.10Garbage Collection Safety . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358 27.7 Non-constant Function Specifications . . . . . . . . . . . . . . . . . . . . . . . . . 358 27.8 Indirect Calls julia> pi = 3 3 julia> pi 3 julia> sqrt = 4 4 However, if you try to redefine a built-in constant or function already in use, Julia will give you an error: julia> pi π = 3.1415926535897... julia> FLOATING-POINT NUMBERS 21 The distance between two adjacent representable floating-point numbers is not constant, but is smaller for smaller values and larger for larger values. In other words, the representable0 码力 | 1692 页 | 6.34 MB | 3 月前3
共 1000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 100













