要素が参照になっていないけども,代入プロパティは存在するようなrange. コンテナにくっついているものが前提.
struct SealedRange
{
import std.stdio : writeln; | |
void main() | |
{ | |
int[] r = [ 1,2,3,4,5,6 ]; | |
writeln("Elements multiplied by 1.5:"); | |
foreach (e; map!"1.5*a"(r.iterator)) |
#------------------------------------------------------------------------------# | |
# Utility Functions | |
#------------------------------------------------------------------------------# | |
# For PROMPT. | |
color_prompt() | |
{ | |
typeset -A colors | |
colors=( 'K' 'black' 'R' 'red' 'G' 'green' 'Y' 'yellow' \ | |
'B' 'blue' 'M' 'magenta' 'C' 'cyan' 'W' 'white' ) |
true | |
tuple((double),"value",5) | |
tuple((double),"value",5) |
diff --git src/interpret.c src/interpret.c | |
index 5a6cf07..bed664f 100644 | |
--- src/interpret.c | |
+++ src/interpret.c | |
@@ -36,6 +36,7 @@ struct InterState | |
Expression *localThis; // value of 'this', or NULL if none | |
bool awaitingLvalueReturn; // Support for ref return values: | |
// Any return to this function should return an lvalue. | |
+ Loc loc; | |
InterState(); |
struct S | |
{ | |
int value = 9999; | |
void change() | |
{ | |
value = 1; | |
} | |
} |
enum N = 20; | |
alias Lambda!(int, N, // P = int, q = N | |
q{ | |
alias P[a][q] _; | |
}) | |
IntArray; | |
static assert(is(IntArray!(3) == int[3][N])); |
void main() | |
{ | |
void f() pure | |
{ | |
} | |
enforce(100, &f); | |
} | |
T enforce(T, DG)(T v, DG dg) pure | |
if (is(DG == void delegate() pure)) |
import std.array; | |
import std.stdio; | |
alias immutable(ubyte)[] bstring; | |
void main() | |
{ | |
auto s = cast(bstring) "abc\rxyz\n\n012\r\n789\r\r..."; |
| | |
| $f = new IO::File "test-dat.txt", "r+"; | |
| | |
open("test-dat.txt",O_RDWR,00) = 3 (0x3) | |
ioctl(3,TIOCGETA,0xbfbfe6d0) ERR#25 'Inappropriate ioctl for device' | |
lseek(3,0x0,SEEK_CUR) = 0 (0x0) | |
fstat(3,{ mode=-rw-r----- ,inode=6335544,size=12,blksize=16384 }) = 0 (0x0) | |
fcntl(3,F_SETFD,FD_CLOEXEC) = 0 (0x0) | |
| | |
| read $f, $s, 2; |