/sandbox is for..?launch RDM, pause it, mute it off, turn speed to 2x but not for me as humantext
H/W path Device Class Description
=============================================================
system 350V5C/351V5C/3540VC/3440VC (P10AAL.032.CP)
/0 bus NP350V5C-S07RU
/0/0 memory 64KiB BIOS
/0/41 memory 1MiB L2 cache
/0/42 memory 256KiB L1 cache
/0/43 memory 6MiB L3 cache
/0/44 memory 6GiB System Memory
/0/44/0 memory 2GiB SODIMM DDR3 Synchronous 1600 MHz (0,6 ns)
/0/44/1 memory DIMM [empty]
/0/44/2 memory 4GiB SODIMM DDR3 Synchronous 1600 MHz (0,6 ns)
/0/44/3 memory DIMM [empty]
/0/45 processor Intel(R) Core(TM) i7-3610QM CPU @ 2.30GHz
/0/100 bridge 3rd Gen Core processor DRAM Controller
/0/100/1 bridge Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port
...sudo lshw -short :sunglasses: ~/C/gritter ❯❯❯ red ✘ 1 --== Red 0.6.3 ==-- Type HELP for starting information. *** Runtime Error 1: access violation *** at: F7EBCC15h
-d to see what's going on.pull ed latest sources and recompiled consoleE:\Development\red>console.exe --== Red 0.6.3 ==-- Type HELP for starting information. >> about Red for Windows version 0.6.3 built 26-Mar-2018/13:23:41+02:00
*** Runtime Error 1: access violation *** Cannot determine source file/line info. ***
/compact mode that throws lot of it away and uses just about 1/3 memory. But I still get crash (non-related to the problem I've reported in bugs room). I now know where it's coming from, so expect another bug report once I isolate it.circular!: object [ size: 5 list: [] init: func [ siz ] [ size: siz clear list insert/dup list 0 1 + size ] on-deep-change*: function [owner word target action new index part][ switch action [ insert [ remove target ] ] ] ]
>> b: make circular! []
== make object! [
size: 5
list: []
init: func [
siz
][
size...
>> b/init 20
*** Runtime Error 1: access violation
*** at: 08078661hon-deep-change* ?size: siz so I suspect it's stack related.bullshit,bullshit there and now it works fine. We could have known.subject and advance provided the latter will return unset! on no items,._1<\.i.10 my nerves here!Blood Omen: The Legacy of Kain; this is it
lc: [ti si siht]
rlc: copy []
foreach el1 lc [
t: type? el1
append rlc to t reverse to-string el1
]
reverse rlcload reverse form [ti si siht]?reverse mold/all [ti si siht]load swap x: reverse mold [ti si siht [tis]] back tail xMatrix + transform @toomasv ?mirror: func [t [string!] /view /with fnt /local tx bx s][ layout/only compose either with [[tx: text font fnt (t)]][[tx: text (t)]] s: size-text tx x: either with [fnt/size][2] bx: compose/deep [box (as-pair s/x + x s/y) draw [transform 0x0 0 -1 1 (as-pair s/x + x 0) text 0x0 (t)]] if with [insert last bx [font fnt]] either view [system/words/view bx][bx] ]
mirror/view "Try some leonardic writing!" ; See output below view compose/only [panel gold (mirror "Try some leonardic writing!")] f: make font! [name: "Lucida Sans Unicode" size: 26 style: [italic]] mirror/with/view "Leonardo da Vinci wrote mirrored text - you can too!" f
; f as above mirror/with/view reverse "Leonardo da Vinci wrote mirrored text - you can too!" f
mirror.red - it crashed silently with view mirror/with "Some text" font. Now [corrected](https://gist.githubusercontent.com/toomasv/357b022f298ff90d821477324e9c8cf4/raw/02e88988e820b2aeb03b30d4dd8da7585c24f939/mirror.red))transform before, at least not since R2 in small ways, and was scratching my head a bit when it didn't work for me. I will study your code and learn!box's working has something to do with its transparency. Transparency management is tricky thing.transform is straightforward, matrixis tricky because of it's rotation management. But matices can be added, while transform and its little brothers (translate, scale, rotate) can just be stacked (which is often all you want).transform, what do you refer to exactly?basis keyword where you define x and y ?rotate around x for 60 degrees or set the matrices more conveniantly?cat, you make a symbol (i.e. conventional representation) of cat.at some point in space/time, i.e not necessarily currently.(((,[:+/_2&{.)@](^:(2-~[)))&1 1)get me thinking: would you like to read that code few months later? fibs = 0 : 1 : zipWith (+) fibs (tail fibs). It's much simpler to understand for me. if or while . Indentation matters too (pseudocode):if (a = (b + c)) [print "hello world"]
if (a = (b + c)) [ print "hello world" ]
if (foo?) [ print "bye world" ]
The ball is red vs ball = red.133...7 message counts?0 2 1 3 permutation to my nickname0 2 1 3 C.":9214 9124
i.4 0 1 2 3 0 2 1 3 C.i.4 0 2 1 3
#(
id: "5985fce7614889d4751fba4f"
text: {^/closure: func [vars spec body][func spec bind body context vars]^/}
sent: 5-Aug-2017/17:14:15.381
v: 1
author: "9214"
room: "red/help"
room-id: "5780ef02c2f0db084a2231b0"
)No, you can’t create image from block of tuples.>> probe m/9214
#(
id: "5ab1070cfa066c53254f538d"
text: {```text^/block: [1 2 3 4 5 6 7 8 9 10]^/changes: [^/ [02 04 21] ^/ [06 07 42] ^/ [09 10 03]^/]^/^/forall changes [^/ transform: changes/1^/ change/part^/ at block transform/1^/ transform/3^/ max transform/2 - transform/1 2^/ probe block^/]^/```}
sent: 20-Mar-2018/13:05:16.852
v: 1
author: "9214"
room: "red/help"
room-id: "5780ef02c2f0db084a2231b0"
)#(
id: "5acf63577c3a01610dd59dfc"
text: "@9214 like this one?"
status: true
sent: 12-Apr-2018/13:47:03.577
mentions: [#(
screenName: "9214"
userId: "57dad69540f3a6eec06570e4"
userIds: []
)]
v: 1
author: "9214"
)status: true means, it's not in standard messages.Let's create a new Skynet :|machine-name.your.domain with a simple oneliner:forever [cloudflare/update-dns-record "your.domain" "A" "machine-name" first split read http://ip.changeip.com/ newline wait 300]
struct node {
int data;
struct node *prev;
struct node *next;
};void insert(struct node **head, int data){
struct node *new = make(data);
if (!head){ // I have no idea what I'm doing
printf("!!!\n");
*head = new;
} else {
(*head)->prev = new;
new->next = *head;
*head = new;
}
}void main(){
struct node *head;
insert(&head, 1);
show(head);
insert(&head, 2);
show(head);
}head = insert (head, 1) head = insert (head, 2)
head == NULL, I'm just not sure what exactly check by null (head? *head?). Whichever combination I use ain't do the trick. if (!*head) did the trick.struct node *head = NULL;*, it's value, you would get a segfault.void *x = NULL and ctor() { x = NULL; } and none fired :)10000000 * some_value. You can allocate smaller part and "re allocate" it later but in worst case you would have to copy whole array. #ifndef NULL #define NULL ((void *) 0) #endif
void *x = NULL and ctor() { x = NULL; } and none fired :)RXXYYYY. If you want to resize Xs you have to copy it somewhere else or move YYYY... (size of pool + 1)?(*p) = default_object construct to init them, but = of course didn't know that (*p) contains junk, but thinks it's a valid objectrealloc()new()parse is a sin.17 means a number of pluses?if, while, functionetc.) should be *type-able* on most keyboards. Unless you are programming with people that use one natural language. text >> x: 'a y: 'b f: func [x y][set x also get y set y get x] == func [x y][set x also get y set y get x] >> f 'x 'y == b >> x == b >> y == a
get/any doing exactly, so an exchange can be done without an intermediate?get/any so it won't matter what it's doing :)get/any functions are just casting the stack argument to the appropriate data-type.integer!:get-any*: func [ ;-- special get* variant for SWITCH return: [integer!] /local int [red-integer!] ][ ; print-line ["get-any* integer"] int: as red-integer! stack/arguments either TYPE_OF(int) = TYPE_INTEGER [int/value][0] ;-- accept NONE values ]
get-any: func [ word [red-word!] return: [red-value!] ][ #if debug? = yes [if verbose > 0 [print-line "word/get-any"]] copy-cell _context/get word stack/push* ] get: func [ word [red-word!] return: [red-value!] /local value [red-value!] ][ #if debug? = yes [if verbose > 0 [print-line "word/get"]] value: copy-cell _context/get word stack/push* if TYPE_OF(value) = TYPE_UNSET [ fire [TO_ERROR(script no-value) word] ] value ]
witchery: :magic!system/lexer/pre-load: func [src][replace src "The answer" "42"] ; == func [src][replace src "The answer" "42"] answer: The answer
system/lexer/pre-load: func [src] [replace src "? bird!" "browse https://www.youtube.com/watch?v=2WNrx2jq184"] ? bird!
404 undefined reference to with idris_rts.o/idris_rts.cok but he/she really clicked cancel).DoSparse. Here is simple DSL using function + block:foo: func [name block /local ind][
print ["user: " name]
ind: 0
foreach w block [
prin ind prin ": "
print w
ind: ind + 1
]
]
foo "baz" [
abc
def
ghi
]
; user: baz
; 0: abc
; 1: def
; 2: ghiparse might be helpful but I'm not sure what your DSL looks like. import sat.
main =>
queens(8).
queens(N) =>
Qs = new_array(N,N),
Qs :: 0..1,
foreach(I in 1..N) % 1 in each row
sum([Qs[I,J] : J in 1..N]) #= 1
end,
foreach(J in 1..N) % 1 in each column
sum([Qs[I,J] : I in 1..N]) #= 1
end,
foreach(K in 1-N..N-1) % at most one
sum([Qs[I,J] : I in 1..N, J in 1..N, I-J=:=K]) #=< 1
end,
foreach(K in 2..2*N) % at most one
sum([Qs[I,J] : I in 1..N, J in 1..N, I+J=:=K]) #=< 1
end,
solve(Qs),
foreach(I in 1..N)
writeln(Qs[I])
end.add something. I just said this should be *something*. foreach is just for convenience - I can just do it manually. foo is the same. users-data: skip load http://rebolek.com/stats/data/red/user-list.red 2 foreach user users-data [users/(user/1): user/2] your-id: select users your-name ; replace your-name with your name print load rejoin [http://rebolek.com/stats/data/red/users/ select users your-id %.red]
>> print load rejoin [http://rebolek.com/stats/data/red/users/ select users "rebolek" %.red]
name: "rebolek"
id: "5565a4bf15522ed4b3e100bc"
first: 27-May-2015/11:28:04.793
total: 7628
avatar: https://avatars-02.gitter.im/gh/uv/4/rebolek
days: 26-Mar-2018
rooms: #(
"red/red" 2695
"red/help" 1730
"red/red/welcome" 900
"red/red/gui-branch" 880
"red/blockchain" 280
"red/sandbox" 256
"red/chit-chat" 238
"red/bugs" 222
"red/red/system" 85
"red/red/code" 63
"red/mezz" 57
"red/docs" 55
"red/red/map-datatype" 50
"red/red/lisp" 39
"red/Czech" 25
"red/red/RIF" 15
"red/audio" 13
"red/Russian" 7
)users-data: skip load http://rebolek.com/stats/data/red/user-list.red 2 users: [] foreach user users-data [put users user/1 user/2] your-id: your-name ; replace your-name with your name print load rejoin [http://rebolek.com/stats/data/red/users/ select users your-id %.red]
do [ ; Use `do` so `ask` works when pasting it all into the console print "^/So, you want to see your Gitter stats^/" users-data: skip load http://rebolek.com/stats/data/red/user-list.red 2 users: [] foreach user users-data [put users user/1 user/2] your-id: ask "Enter your username: " print ["^/Stats for" your-id] print load rejoin [http://rebolek.com/stats/data/red/users/ select users your-id %.red] ]
parse-apache-time I started thinking about collection of parse rules, like parse library you knowws package?ws : charset reduce [space tab newline cr lf crlf]>> redquire 'json init load-list *** Access Error: cannot open: %none/.redquire/packages.red *** Where: write *** Stack: redquire
HOME on Windows?>> get-env "USERPROFILE" == "C:\Users\Šumichrást Malbohráz"
>> redquire 'json init load-list load-package json download-package json *** Access Error: cannot open: %/C/Users/1/C:\Users\1/.redquire/packages/ *** Where: do *** Stack: redquire do-file change-dir cause-error
>> cd / == %/ >> redquire 'json init load-package json *** Access Error: cannot open: %/C:\Users\1/.redquire/packages/ *** Where: do *** Stack: redquire do-file change-dir cause-error
>> redquire!/path: to-red-file redquire!/path
== %/C/Users/1/.redquire/
>> redquire 'json
init
load-package json
== make object! [
quoted-char: make bitset! #{000000002001000000000008220228}
exponent: make bitset! #{000000000000}
sign: makredquire 'nsource :) it's the most useful>> t0: now/time/utc do https://rebolek.com/redquire now/time/utc - t0 == 0:00:10
your-package needs 1.X.X, there is 1.2.2 - no download required). to-red-file fix, but forgot to push it...redquire also.read %. will read stuffs so... yeah.sort read %. - it seems to work on windows.sort/compare (read %.) func [a b] [ (query a) > (query b)]?query?? queryread %. reads the file/directory list. You can (it's one of the option) build upon it. read workscall).ps or a windows alternative you don't need to know OS internals*.red files). It doesn't need anything else. read %. is good enough for this.shell/register make shell-command [
; dummy ls - just outputs content of first argument
command: 'ls
run: func [] [
either file? arguments/1 [
stdout: read arguments/1
exit-code: 0
] [ exit-code: 127 ]
]
]query isn't even listed on red-by-exampleread %. does the same job. Your library is probably bigger than my code. read is enoughcall using tasklist & taskkill commands, no need for read %. therepry was very powerful. https://gist.github.com/greggirwin/d40a0e3b4c8de31a7d3b82695b9b4b03](https://gist.github.com/greggirwin/d40a0e3b4c8de31a7d3b82695b9b4b03)>> composite {a :(1 + 2): b}
== "a 3 b"
>> composite {a :("1 + 2"): b}
== "a 3 b"
>> composite {a :({{1 + 2}}): b}
== "a 1 + 2 b"https://gist.github.com/hiiamboris/d4716ade2171a5c4c5ed9f96fbfd5446](https://gist.github.com/hiiamboris/d4716ade2171a5c4c5ed9f96fbfd5446)bind word .. had no effect, fixed it by re-setting the word word: bind word ..composite/with tests look OK to me.composite, what was your reason for removing the error handling at the top of eval, when loading expr?composite, what was your reason for removing the error handling at the top of eval, when loading expr?composite/with tests look OK to me.f: func [w][
...
composite/with ":(w):" context? 'w
]
>> f 100
== " *** Error: no-value Where: w *** "build-markup, but not a more general solution. Reword was added to R3 for this purpose.[“My name is” name]. Kind of like the mirror image of string interpolation, or bizarro interpolation, because they aren’t string-centric languages {mpv "(vfile)" --audio-file "(afile)"} vs[{mpv "} vfile {" --audio-file "} afile {"}][foo " " baz " bar: " qux]{$(foo)$ $(baz)$ bar: $(qux)$}"#{foo}"{$foo$ $baz$} in my code.:( and ): emojis, as well as $( and )$ is that in a long string, like lots o' stuff....):(.... more stuff it isn't immediately clear if ):( is an opening or a closing part(: / :) would've been better, although still quite bulky$...$ and #{...} are fine I thinkload when money! comes?"foo" or {foo}). I think only few things are not allowed in the string.string!, I'm not going to load it anywayarr: [aaa bbb ccc eee] ; [aaa bbb ccc eee] e: func [str] [ composite/marks/fun str ["#" " "] func [s] [arr/(to-integer s)] ] e"#1 #3 #2 " ; "aaacccbbb"
" " or "^/" kind of things (**can we?**), so I just let it be ugly trailing space... oh well."#1 + #2 = " you don't see it. 1+ 2= 2form? I’m not at a computer at the moment. (I know, more computationally expensive)composite/marks "1 + 1 = ╯°□°)╯︵ ┻━┻2|" ["╯°□°)╯︵ ┻━┻" "|"]1+ 2= 2" "composite/marks "#1 + 2 = <something>" ["#" " "] ;*** Syntax Error: missing "#" at " + 2 = <something>" ; *** Where: do ; *** Stack: composite cause-error
composite/marks/fun "foo#1#" ["#" "#"] func [s] [type? s] e: func [str] [composite/marks str [MARK-START MARK-END]] e"foo" composite may supportxpand: func [x /with c][composite/marks/with x ["(" ")"] context? any [c 'xpand]]/withcomposite if you need simple string interpolation you can use e-like mezzazines.@foo = 21 @baz = 2 @qux = 42 puts "#@foo * #@baz = #@qux"; ; 21 * 2 = 42
:( … ): markers already have meaning in Red. Colons are used to get and set values, and parens indicate evaluation. 2 chars on each end, in this combination, shouldn't appear often in human text, or in Red data (I didn't say *never*, just not often).composite?composite/marks "1 + 2 = @something@" ["@"]composite is on the github too... shouldn't you people prefer it over gist? I think github's version should have the newest version (I cannot load github so I cannot check it).composite/marks str "@" to mean composite/marks str ["@" "@"]:( ... )? We should omit : at the end because, as hiiamboris mentioned (I think) part ):(in the string ":( some stuffs here ):( some other stuffs here" might be confusing. composite is on the github too... shouldn't you people prefer it over gist? I think github's version should have the newest version (I cannot load github so I cannot check it).markers, and have done that in the past. Still not sold on it, as it opens other questions. e.g., then why require a block for them at all, as @nedzadarek notes. If this were a function that saw as much use as [if either foreach func ...], shortcuts have more value. Running the contributed command:'red.interpret' failed.
[2018-06-23 03:13:04.869] [exthost1] [error] TypeError: Cannot read property 'fsPath' of null
%20 instead I believe.X:\\folder\\red.exenull related.C:\Users\Old Man\red.exe --cli "c:\Users\Old Man\Desktop\docs\en\testy.red" 'C:\Users\Old' is not recognized as an internal or external command, operable program or batch file.
-r, or other flags? Or are we stuck with -crows: collect [foreach row read/lines %hightemp.txt [ prefecture: first split row tab map/:prefecture: either map/:prefecture [map/:prefecture + 1][keep prefecture 1] ] ]
foreach row read/lines %hightemp.txt [ prefecture: first split row tab map/:prefecture: 1 + any [map/:prefecture 0] ] rows: keys-of map
map/:prefecture: 1 + any [map/:prefecture 0]
any.alland any were much slower than if and either. Need to double-check this.any/all>> select gb/data "Brno" == [49.19522 16.60796] >> select gb/data "Lhasa" == [29.65 91.1] >> gb/distance "Brno" "Lhasa" == 6478.254968608579
/help and /parse so I'll put it here. parse, the Perl 5, the Perl 6 and stuffs. parse should be "more powerful" than other mainstream RegExp engines ("if you need to parse html don't use RegExp"). The RegExp, a regular grammars are level 3 of chomsky hierarchy. parse is from Top-down parsers - they are from Context-free grammars (2nd level). Are there things that you wish you had mainstream Regular Expressions in the Red/Rebol? Are something easier using Regular expressions than parse? parse? grammar Parser {
rule TOP { I <love> <lang> }
token love { '♥' | love }
token lang { < Perl Rust Go Python Ruby > }
}
say Parser.parse: 'I ♥ Perl';
# OUTPUT: 「I ♥ Perl」 love => 「♥」 lang => 「Perl」
say Parser.parse: 'I love Rust';
# OUTPUT: 「I love Rust」 love => 「love」 lang => 「Rust」parse. Again, what's the difference between the Perl 6's Regular Expression "system" and parse? Is one more powerful/faster than other? parse. like? func is probably on rebol.org. If not, I can dig it up."b" instead of "c" at 3rd position:regex/spec "abc" ; [to [#"a" #"b" #"b"] ; copy &0 thru [#"a" #"b" #"b"] (put & 0 &0) to end ; ]
readme.md or something. I guess. You can create issues yourself so you can have list of problems in your code.u, but thank you.do + some files) but I haven't changed the repository nor I haven't written Red/System-level modules. The internals are too complex for me at the moment. Will new module system help people like me to write such modules?Red/System is a dialect (DSL) of the Red programming language. Its purpose is to provide:
-low-level system programming capabilities
-a tool to build Red's runtime low-level library
-a tool to link code and produce executables
Red/System can be seen as a C-level language with memory pointer support and a very basic and limited set of datatypes.
Implementation note: It is currently provided with a complete tool-chain generating executables from source files. This is a temporary state as Red/System will live inside Red, so will be embedded in Red scripts.linux-gui?/ vs /f. It's one of the most mature but you can try other from their site as they are small.camel_case names.Demo:Start
Msg:Add ("Quick Demonstration","Ok")
Sure you can say "Hello World" in one line of
C code. But how many punctuation characters
are required to display a dialog box like this?
Return (Ok)falling?: falling'foo') but "temporary variables" doesn't need it (|c|)counter(object) doesn't understand decrement is not hard to understand thought)unless falling? somewhere, so easy to remove. But you're supposed to wait, since a match you wanted to make might not be possible anymore once all blocks have fallen and chain reactions destroyed other blocks. So being able to move them while they are falling could be considered a bit of a cheat. But I think some match 3 games do allow it, so it could be considered a matter of taste.better hello world. composeing or building your own faces. view [style blue-base: base red blue-base "Red"]) then it will be less complex. ( and )) but I still find it bad for lisp languages. Making parenthesis barely visible might change my point of view but I haven't tried it... yet.b1 set to some byte and h having hash... what if your hash is modified too?mod index - 1 COLSfor calculating the x index? You can just use
index - (y * COLS), so you don't have to use an expensive mod.
FPS: 100 or 200 I get 63-64 on FPS meter>> delta-time [i: 0 n: 25 view [box 100x100 rate n on-time [if n = i: i + 1 [unview]]]] == 0:00:01.189 >> delta-time [i: 0 n: 50 view [box 100x100 rate n on-time [if n = i: i + 1 [unview]]]] == 0:00:01.58 >> delta-time [i: 0 n: 100 view [box 100x100 rate n on-time [if n = i: i + 1 [unview]]]] == 0:00:01.583 >> delta-time [i: 0 n: 200 view [box 100x100 rate n on-time [if n = i: i + 1 [unview]]]] == 0:00:03.131 >> delta-time [i: 0 n: 400 view [box 100x100 rate n on-time [if n = i: i + 1 [unview]]]] == 0:00:06.261
on-time event is 6.26 / 400 = 15.6ms even though it doesn't load the CPU at allrepeat y ROWS [repeat x COLS[ then?mod is not 1 operation, it's a whole mezzanineindex - (y * COLS) seems to be wrong, now all the gems are falling through the bottom :P it has to be i - 1 - (y * COLS) That's the one downside of Red counting from 1, not 0. You have to do - 1 in some cases.repeat i (ROWS * COLS) [
y: i - 1 / COLS
x: mod i - 1 COLS
append gems random-gem x y
]i used because of convenience here?loop 10000 [wait 1e-3] in Red, watch the CPU load (wait calls Sleep)Sleep(1) to skip 1msyield() regardless if you want it or not, so 100% is unachievable, at least that's how I see itnow/time/precise on windows to 100ns precision... gonna make a PRgit fsck --lost-foundos error 123 pijul init so whatever is incorrect there I will never knowversion containing 0.9.1 while it reports 0.10.0 from command line'config.cson I added autoCompleteCharaccters so it won't match ' like in lit-word! (e.g. 'foo):".rebol.source":
"bracket-matcher":
autocompleteCharacters: [
"[]"
"{}"
"()"
"<>"
"\"\""
]
editor:
scrollPastEnd: true
showIndentGuide: true>> delta-time [i: 100 view [base 100x100 rate 100 on-time [wait 3e-2 if 0 = i: i - 1 [unview]]]] == 0:00:03.047
%/C/ProgramData/Red/red-063.exe --cli /home/chris/....cannot open: %/home/chris/Documents/GitHub/red-scripts/ because %/home/chris... doesn't exist in the wine environment.red.redPath in Visual Studio Code to the script here: https://gist.github.com/cryptowyrm/0b2e189dcd0e3d80e154481a088ac652 (and change the path to wherever you put red-063.exe)audio! and video!, many things will become possible.add 3 4 5 6 7#macro ['add some number!] function [s e][
acc: 0
foreach x next copy/part s e [acc: acc + x]
]#macro ['max some [integer!]] func [s e][
first maximum-of copy/part next s e
]
print max 4 2 3 8 1maximum-of definition.last sort copy/part next s e instead.text
#do [
maximum-of: func [series][first sort/reverse copy series]
]
#macro ['max some integer!] func [s e][
maximum-of copy/part next s e
]add be non-fixed arity?text
order: func [block item /skip size /head /tail][
also block (
while [not tail? next block][
block: insert system/words/skip block any [size 1] item
]
case/all [
head [insert system/words/head block item]
tail [append block item]
]
)
]
probe do order [3 4 5 6 7] '+
probe do append order/head [4 2 3 8 1] 'max 1add be non-fixed arity?sum [...] and product [...]?#do [
fold: func [op a b /local x][unless op? :op [op: make op! :op] foreach x b [a: a op x] a]
rule: [['+ | '- | '* | '/ | '// | '% | '** | 'max | 'min] some scalar! end]
]
#macro [ahead paren! set b into rule] func [s e][ fold get b/1 b/2 skip b 2 ]
probe (+ 1 2 3 4 5)
probe (* 1 2 3 4 5)
probe (** 2 2 2 2)
probe (/ 100 2 5)
probe (min 4 7 3 4 1)
probe (max 4 7 3 4 1x1); lots of code that sets values total: deposit my-acct add pay-1 pay-2 pay-3 invoice-1 transfer total dest
add should happen to change, producing either an incompatible type for the op, or one that isn't consumed by the macro at all, your behavior changes in a way that may be very hard to see. It takes Red's already powerful free-ranging evaluation model and adds a quantum element to it. map if you don't want to fold into one element.function! takes. In Greg's code: total: deposit my-acct add pay-1 pay-2 pay-3 invoice-1 do you mean total: deposit my-acct (add pay-1 pay-2 pay-3) invoice-1 or total: deposit my-acct (add pay-1 pay-2) pay-3 invoice-1? sum [...] and product [...] funcs?add and multiply could consume blocks of values, that would be dandy. And we wouldn’t need extra built-ins like sum and productadd+ mezzanine that works how you want, and we can make concrete comparisons.-we[]>> -we[(-wta "wa") (-wta "was")]
== make object! [
text: "me and us"
textnx: "me and us"
title: "was"
... -we[]foo in foo foo only once)Linq?string[] names = { "Burke", "Connor", "Frank",
"Everett", "Albert", "George",
"Harris", "David" };
IEnumerable<string> query = from s in names
where s.Length == 5
orderby s
select s.ToUpper();
foreach (string item in query)
Console.WriteLine(item);names: ["Burke" "Connor" "Frank" "Everett" "Albert" "George" "Harris" "David"] foreach s sort collect [foreach s names [if 5 = length? s [keep uppercase s]]][print s] BURKE DAVID FRANK
"kedi köpek, kuş, karınca, inek" split(", ", " ") {@} ; ["kedi", "köpek", "kuş", "karınca", "inek"]
"kedi köpek, kuş, karınca, inek" split(", ", " ") {@ [-1]} ; ["inek"]
"kedi köpek, kuş, karınca, inek" split(", ", " ") {@ ![-1]} ; ["kedi", "köpek", "kuş", "karınca"]
"kedi köpek, kuş, karınca, inek" split(", ", " ") {@ <_"k">} ; ["köpek", "karınca"]split and resultyes in your conlang :(markup language to Polishdocsciekawa is the word in your or not-polish language?ei as ie).ciekawa in Polish, but I am not sure, may be it should have been ciekawy or something. Nie wiem.ciekawe (it is interesting). Masculine, feminine and neutral forms are not easy to "get" for non-native speaker so don't let it bother you.+ is good thing, - is bad thing or some error):A es xini - I think you mean A bes xinibe: SVO 2) other verbs: VSO a (a bed)there is an too (an apple). s to z (I forgot how it was called) - I would use n > m for the house - kasaN and house kasaM but it's your choicekasaM/kasaN)SOV. So VSO is more difficult/different for Turkishes. But it's more near to a programmer, i guess.komu: func [subject object][...] komu "wa" "ika"
subject: make object! [verb: func [object] [print object * 10]]) you may call functions like object1: 42 subject/verb object1.>> a: -es -wta "ta" -i["nagi"]
== make object! [
text: "you are tall"
]
>> a/text
== "you are tall""wa".komu "ika"
komu is a funccall bug in the latest Rebol/View.none value to cause an error instead of returning none itself.>> thing: [a [b 1]] == [a [b 1]] >> thing/a/b == 1 >> thing/a/c == none >> thing/b/c *** Script Error: path thing/b/c is not valid for none! type
thing/b/c return none instead? It seems like a common pattern, especially when working with external data.attempt [thing/b/c]None propagation is a tricky subject. It seems nice to just cover up all errors, but at some point it makes it harder to reason about *anything*, because you don't get helpful errors.none worked that way, integers, words, and others would still fail.attempt seems just right. It hadn't occurred to me that it returns none if it fails"gltewalt" 8
"greggirwin" 5
"lepinekong_twitter" 3
"meijeru" 3
"toomasv" 2"greggirwin" 86
"gltewalt" 61
"9214" 60
"toomasv" 32
"Respectech" 22
"meijeru" 20
"lepinekong_twitter" 15
"Rebol2Red" 11
"endo64" 11
"alexbaban_twitter" 10"greggirwin" 310
"toomasv" 188
"gltewalt" 182
"abdllhygt" 162
"9214" 131
"lepinekong_twitter" 88
"nedzadarek" 83
"rebolek" 81
"endo64" 78
"BeardPower" 68red/docs room, and lots of internal work going on, judging by @greggirwin and @dockimbel busyness.greggirwin 76 toomasv 68 dockimbel 40 lepinekong 28 rebolek 24 iArnold 19 meijeru 18 nedzadarek 17 maximvl 13 9214 12 hiiamboris 9 rgchris 7 DideC 6 honix 6 Mufferaw 6 guaracy 5 Oldes 4 luce80 4 Phryxe 3 WayneCui 3 Skrylar 3 qtxie 3 pbaille 3 x8x 3 fvanzeveren 3 kermitaner 3 PeterWAWood 2 AlexanderBaggett 2 dander 2 endo64 2 mydoghasworms 2 JacobGood1 2 koba-yu 2 Arie-vw 2 Cybarite 2 Dobeash 2 giesse 2 BeardPower 2
language:red as a parameter. url: to-url rejoin [http://gist.github.com/search?p= cp "&q=language:red"] then scraping the resulting html pages.do and load them via Github URL that way.grep them for words in order to find examples./help room instead? :)help me in the console, you get results>> qobom messages [keep 'author where 'sent > (now - days 365) count]
== #(
"9214" 11525
"BeardPower" 6433
"greggirwin" 5225
"rebolek" 4417
"gltewalt" 2975
"toomasv" 2204
"nedzadarek" 2129
"maximvl" 1926
"lepineko...
>> qobom messages [keep 'room where 'sent > (now - days 365) count]
== #(
"red/help" 16682
"red/red" 16243
"red/red/welcome" 5834
"red/chit-chat" 4884
"red/red/gui-branch" 4861
"red/blockchain" 3392
"red/bugs" 2960
...qobom..?keep key/\* where key *comparator* value/contains value/is from values/matches parse rulekeep * keeps whole map, keep key only that key's whalue that can be counted later with count as in examples aboveand word that lets you combine multiple comparators together - keep * where 'author is "9214" and 'room is "red/red"or also, but that's not implemented yetqobom) reminds me of some word from (I guess) your language that you used in some code. I don't remember it. It was used for element of block of index -2 or index + 2. wat: :what>> print-top top-chatters/last-7days 1. @rebolek - 103 2. @9214 - 75 3. @endo64 - 34 4. @nedzadarek - 33 5. @guraaku - 32
stream: open io://
write stream [int32 6523 string "Hello"]
;which would create binary: #{7B1948656C6C6F00}read/??? stream [int32 string] ;could return [6523 "Hello"]
read refinement ????s-out: make stream-io []
s-out/writeUI16 6523
s-out/writeString "Hello"
probe head s-out/outBuffer ;== #{7B1948656C6C6F00}
s-in: make stream-io []
s-in/setStreamBuffer copy head s-out/outBuffer
probe reduce [s-in/readUI16 to-string s-in/readString] ;== [6523 "hello"] read has /as refinement for encodings:/as => Read with the specified encoding, default is 'UTF-8.
encoding [word!]select? But there is again confusing docstring.select would be even more confusing... and it could be also reserved for some other functionality with stream.read/as STREAM int32 - I would assume that int32 is some kind of encoding. It's ok for now. read/as STREAM [int32 string] - are you reading int32 or string? I don't think it's *possible*. So maybe int32 **then** string? Make sense. read/as file encoding to read/as stream [type1 type2].int32 or string looks like encodings, so I guess the name should stay.read/as is not so bad. And of course... whou know what Nenad have in his notes for full IO in Red.>> foreach message qobom messages [keep ['author 'text] where 'sent > (now/date - 30) and 'text contains "news"][print [#"*" message/1 #"-" message/2] ] * greggirwin - For Rebol, the official %json.r (from json.org) is the way to go. For Red, if the one in the wallet code does all you need, that's my first choice. But, the great news is that there's work underway on an official JSON codec for Red, so stay tuned. * alexbaban_twitter - This might not be a bug in Red, but a compiled macOS Red executable, can't read/write to files in latest Sierra. If I launch the program from console it works, but errors if is compiled. Anybody knows a workaround or any news about being fixed. Thank you. https://github.com/red/red/issues/3207 * maximvl - what's the news? :D * gltewalt - There was a 'in-progress' announcement. https://www.red-lang.org/2018/03/red-foundation-news.html
lit-word!s?[author text].Read/as seems like a good choice, as using a block for the refinement arg can then be dialected, possibly using a scheme name as the first value. If you put the rules in the codec itself, parsing streams incrementally will be ugly.f: func [v1 [vector!] v2 [vector!]] [ either (length? v1) = (length? v2) ["do something with vectors"] [error "not equal"] ]
vector! LENGTH. So, in pseudo code, it would like this:g: func [v1 [vector! N] v2 [vector! N]] [ ; do something with vectors ]
a/1 OP b/1, a/2 op b/2 etc:1 2 3 * 4 5 6 4 10 18
1 2 3 * 2 2 4 6
* has a rank of 0 for both operands, which means that it operates on individual atoms and produces a result with a shape (another concept) of the larger operand. Which means that your explanation is a bit misleading - * always operates element-wise, unless you explicitly specify rank with ".[42] the compiler/interpreter/magic should put an information that you have created a container with a number 42. arr: [42], any implementation of the Red should allow this construct and an access to that block (e.g. print arr/1).f: func [n] [print "half - whole" repeat i n [print [i * 0.5 " - " to-integer (i * 0.5 * 10 / 5)] ]] f 10
comment {
half - whole
0.5 - 1
1.0 - 2
1.5 - 3
2.0 - 4
2.5 - 5
3.0 - 6
3.5 - 7
4.0 - 8
4.5 - 9
5.0 - 10
}text
nip: function [vector index][
floor: at vector unit: to integer! index
any [
attempt [floor/1 + multiply floor/2 - floor/1 index - unit]
floor/1
]
]
probe nip [1 3 7] 2.75
comment [
2 3
0% 25% 50% 75% 100%
3 4 5 6 7
add 3 7 - 3 * 75%
]at works with negative indices.text >> block: at [a b c d] 3 == [c d] >> at block 1 == [c d] >> at block -1 == [b c d] >> at block -3000 == [a b c d]
at.>> block: at [a b c d] 3 == [c d] >> block/-2 == a >> skip block -2 == [a b c d]
copy/part (but I guess it's just clever trick like swapping the indexes)a: [1 2 3 4] a1: at a 3 ; == [3 4] a2: at a -2 ; == [1 2 3 4] copy/part a1 a2 ; == [1 2]
copy handles it by swapping indices around (see [here](https://github.com/red/red/blob/master/runtime/datatypes/series.reds#L1114)).arr: [ [1 2 3 ..] [1 2 3 ..] ]
arr/2/3 to get 3rd value from a 2nd block. Index 2.3 could mean the same as .../2/3. I prefer normal indexing (arr/2/3) but you asked. And we have path that I can do more than mere float!.float!/integer! vs path!. With number you can just pick position. With path you can do more: 'arr/1'arr/1/2'arr/fooparen!: 'arr/(:foo)(1-%,255%~])>./
at or seek? Any opinion?bincode/read b [pos: INDEX SKIP 3 len: UI16 SEEK :pos]
GOTO?seek is winning now. goto. ;)length or size or with ? at end. In this case, I want to be able to return number of bytes in buffer.... like:bincode/read b 'length?
size? for complete size of the buffer and length? for number of bytes from current index.index? instead of index in code above.... it is so hard to define the wording:/at or goto is better than seek. head (insert (at [1 2 3 4] 2) 111). So the order is 1) you do at 2) do something with that.at. However it had "bad past" - people might not like it.bincode/read b [pos: INDEX SKIP 3 len: UI16 AT :pos] it could be read as bincode/read b [at :pos pos: INDEX SKIP 3 len: UI16 ].UI16 command.remaining? is a little bit too human for me.length?I read it like "is it length?" or "has it length?". ? in functions not returning logic too, but on the other side, my editor can show it in different color and I already have LENGTH command in my dialect which writes/reads number as a ASN.1 length tag:/bincode/read b [pos: INDEX SKIP 3 len: UI16 AT :pos] it could be read as bincode/read b [at :pos pos: INDEX SKIP 3 len: UI16 ].read that writes something and write when you read something. We are creating a DSLs so if a DSL has "good rules" it doesn't matter that much whenever or not it uses Red's naming convention.red-chart!, that's something new.red-candlestick!?>> int: make integer! 1 == 1 >> int/value *** Script Error: path int/value is not valid for integer! type *** Where: catch *** Stack:
red-candlestick! you say? https://pbs.twimg.com/media/DnqLRiWX4AA8d9Z.jpg:largeget-word! is enough?[... :pos] instead of [... at :pos] or [... seek :pos] or whatever?get-word! solely for the purpose of backtracking, then any other keyword is superfluous.D. If I want to push/commit something I can just go to the directory (cd D) and do things (git commit -m "message" & git push origin master). When I want to create & work in newly created branch do I have to copy the directory D somewhere like D2 directory? And I have to change directory to D2 (cd D2)?:type is valid too?/10 refinement? :Pbincode is a native in my case.jumpToLabelOrToIndexat is shorter and speaks for itself.seek, at and goto. From your perspective it's just one word (however you call it).git checkout -b new-branch or something like that.big... but is there any statistics how many common file types is using which endianness?do %tardis.redcomplex type? Aka x + yipair! for that?pair! for storing complex value, but not for doing complex math.a+bivscosθ+isenθ? I would just like to have an easy representation for some number z (maybe even q, a quaternion) and have fast/efficient arithmetic for dealing with itadd-complex and etcyes on the *should Red be for everyone?* question, did you?2 + 3im, so showing how to do stuff is quite easy too2j2 or something like that.2x2i, but I'm fine with other solutions.pair! if 2j2 is complex!?pair!..?pitchfork!text if hot? make market! read https://ethereumprice.org/ [to moon! soon: now/time/precise + .0001]
simple-io.complex: func [spec /local c1 op c2][ second-part: [set op ['+ | '- | '* | '/] set c2 block! ( c1: reduce switch op [ + [[c1/1 + c2/1 c1/2 + c2/2]] - [[c1/1 - c2/1 c1/2 - c2/2]] * [[(c1/1 * c2/1) - (c1/2 * c2/2) (c1/2 * c2/1) + (c1/1 * c2/2)]] / [[round/to (c1/1 * c2/1) + (c1/2 + c2/2) / d1: 1.0 * (c2/1 ** c2/1) + (c2/2 ** c2/2) .01 round/to (c1/2 * c2/1) - (c1/1 * c2/2) / d1 .01]] ] )] parse spec rule: [set c1 block! some second-part] c1 ]
complex [[1 2] + [3 4]] ;== [4 6] complex [[1 2] + [3 4] + [1 2]] ;== [5 8] complex [[1 2] + [3 4] - [1 2]] ;== [3 4] complex [[1 2] + [3 4] * [1 2]] ;== [-8 14] complex [[1 2] + [3 4] / [1 2]] ;== [2.4 -0.4] complex [[1 2] + [3 4] + [1 2] / [0 1]] ;== [4.5 -2.5]
#[datatype! optional datatype-specific data ]
#[none!] #[string! "1234" 3] #[function! [x][print x]]
#[pattern which is unique to this alternate representation of Rebol values (you can get them using mold/all, even in Red)
#[true] #[false] #[none]
2j4+, -, * and / for them - just output some text in the form operation * on 2j3 and 4j4ui16 would make more sensef32 would be enoughui16.. but that does not fit with possible f16.. f32 etc6u4? :smile:Fixnum (Integers with maximum/minimum value) to the Bignum (Integers *without* maximum/minimum values). As for 2.5 version it seems that they "merged" it into one class *Integer* (I guess they just keep the Fixnum/Bignum info inside). >> replace/all "Gregg" #"g" #"g" - length? ":^^)" == "dredd"
draw. ;^)sol [
lines not short not straight crossing and touching
drawn at random using 4 colors
uniformly dispersed with maximum density
covering the entire surface of the wall
]telnet towel.blinkenlights.nl [source](https://www.commandlinefu.com/commands/view/1713/watch-star-wars-via-telnet)telnet: https://www.rootusers.com/how-to-enable-the-telnet-client-in-windows-8-1/-machine pc,accel=hvf -cpu host to qemu will make it use the native Hypervisor.framework which should speed up things.*** Script Error: join has no value *** Where: append *** Stack: color
join: https://gist.github.com/x8x/affd2c0b556027b423bfa95c17770096#file-build-console-red-L4 join: func[a b][append copy a b]. As I thought it need some library or something (as pry):←[31mred>> ←[mjoin I've updated the gist https://gist.github.com/x8x/afc2006f245a961ddfa9131bdf15485bjoin error? Strange it's included now.--cli then it works, thought setting Red prompt doesn't, see here:printing (at least on the latest build) works.System RAM Less than 512 MB (-0.31%) 2.91% 512 Mb to 999 MB (-0.88%) 12.22% 1 Gb to 1.49 GB (-1.27%) 20.94% 1.5 Gb to 1.99 GB (+0.47%) 7.75% 2.0 Gb and above (+1.99%) 56.18%
-es -wta "ha" -a "ikan" "n" []-es object [...] object [...]object [
type: "a"
text: ""
who: "ya"
the: false
plural: false
also: true
i: []
]block! - value pair. map! does not support series as a key so I had to use block! (for example: [ [append/only [1] [2]] [1 [2] ]). By using block! I cannot set non-existent key with the set-syntax (bl: [] bl/a: 1). I have to append, put or something like this.molded block version as a key, or even its checksum or binary! representation?molded block version as a key, or even its checksum or binary! representation?binary! representation.mold is not fully implemented, and I think It needs /all and /binary (I do not remember how someone name it) to be usable.molded block is not readable?molded block might not contain all the informations needed (read above sentence).block/key: value feature has any general, concrete use-cases?adoc to the red/rep because block/key: value feature has any general, concrete use-cases?map!. block!... and If I cannot use "set-syntax" I will just use put. E = mc^2?sum must be builtin 064 now. probably needs money!ffact: func [x][either zero? x [1][x * ffact x - 1]]$ wthr This Afternoon.. 47 Rain And Snow Showers Tonight......... 26 Snow Showers Likely Tuesday......... 30 Chance Snow Showers Tuesday Night... 24 Chance Snow Showers Wednesday....... 30 Chance Snow Showers Wednesday Night. 24 Chance Snow Showers Thursday........ 34 Chance Snow Showers then Mostly Cloudy Thursday Night.. 28 Chance Snow Showers Friday.......... 40 Chance Snow Showers then Chance Rain And Snow Friday Night.... 32 Slight Chance Rain And Snow Saturday........ 45 Chance Rain And Snow Saturday Night.. 40 Light Rain Likely Sunday.......... 51 Light Rain Likely then Rain Showers Likely Sunday Night.... 36 Rain Showers Likely * courtesy of Red and weather.gov
[time temperature (C/F/...) weather]1 + 1.red: 0.0.255 blue: 0.255.0advent and code in their messages:>> probe unique qobom messages [keep 'author where 'text contains "advent" and 'text contains "code"] ["dander" "9214" "tsebb" "toomasv" "greggirwin" "Rebol2Red" "BeardPower" "loziniak" "oppih" "GalenIvanov" "ne1uno" "meijeru"]
read-input: function [day][
input-file: rejoin [%day day "-input.txt"]
download-link: rejoin [https://adventofcode.com/2018/day/ day "/input"]
if not exists? input-file [
cookie: rejoin ["session=" read %session-cookie.txt]
response: write/info download-link compose/deep [
GET
[Cookie: (cookie)]
]
write input-file response/3
]
read input-file
]%session-cookie.txtfirst.http-toolsand simplify the code a bit:send-request/with rejoin [https://adventofcode.com/2018/day/ day "/input"] 'GET compose [Cookie: (cookie)]
do line after all... I'm looking forward to the day when we have a built-in package managerCtrl + Shift + M in the entry field.-foreground Yellow) Red/Rebol/Ruby's "actions" looks better. And it has grid system, which Red doesn't (as fair I remember).[1, 2, 3].each {|x| puts x} without giving name to that lambda. print [a a a] could output 1 2 3- I'm not sure how to do this in the Ruby.red/red room would have 666 users.get-data is not simply accessing field like m: #(a: 1) m/a so you need to "compute" something. parse is enough for me : ) but i wait somethings too like gtk supportparse teacher : )0:00:00 -> This 0:50:00 -> That