>> view [base on-created [probe event]] none >> view [base on-create [probe event]] none
on-createD ?view [p: panel [f: field] do [selected: f]]
f although f is not a part of window's paneview [p: panel [f: field] with [selected: f] do [selected: p]]
set-focus actually places the focus properly but does not follow the face hierarchy:>> view [p: panel [f: field] do [set-focus f ? selected/type ? f/parent/type]] SELECTED/TYPE is a word! value: field F/PARENT/TYPE is a word! value: panel
>> ?? set-focus
set-focus:
func ["Sets the focus on the argument face"
face [object!]
/local p
][
p: face/parent
while [p/type <> 'window] [p: p/parent]
p/selected: face]selected facet that matters, and it's the one of window face, others are only taking memoryselected as of an abstraction.. Idk, it just seemed natural to me? Like imagine you have a tab-panel with a few pages, on each page you would have a selected face, and then by selecting a tab you could physically activate a face on that tab that was previously focused. This way you would go all the way down the panes of selected faces to determine which window has focus.set-focus to selected face in a tab-panel when shown.level: 0 current: copy [] internal-path: copy "" decode-path: function [ path-value ] [ path-word: copy "" print ["Path: " path-value] foreach [character] path-value [ character: to-string character print ["Character: " character type? character] either ((character = ":") or (character = "/")) [ print ["Level" level "SHOULD BE A NUMBER!"] level: level + 1 append-to-internal-path path-word print ["Path Word: " path-word] path-word: copy "" ] [ append path-word character print ["Value of PATH-WORD: " path-word]] ] ] print ["Level (Before Function)" level ] mypath: "server:database/tables/field" decode-path mypath
Level (Before Function) 0 Path: server:database/tables/field Character: s string Value of PATH-WORD: s Character: e string Value of PATH-WORD: se Character: r string Value of PATH-WORD: ser Character: v string Value of PATH-WORD: serv Character: e string Value of PATH-WORD: serve Character: r string Value of PATH-WORD: server Character: : string Level none SHOULD BE A NUMBER! *** Script Error: + does not allow none! for its value1 argument *** Where: + *** Stack: decode-path >>
function without understanding how it works. function gather all set-word!s inside body as locals, and your usage of level: prompted it to collect that word. Formal parameters of refinements (/local is a refinement too) are set to none by default.>> find spec-of :decode-path 'local == [/local path-word character level]
~~~started test~~~ base-self-test ===group=== to-image check --test-- tic-1 size adequacy FAILED************** --test-- tic-3 capture of color blending FAILED************** ~~~finished test~~~ base-self-test Number of Tests Performed: 71 Number of Assertions Performed: 320 Number of Assertions Passed: 318 Number of Assertions Failed: 2 ****************TEST FAILURES****************
system/view/metrics/dpi value?192 confirmed.lisp --test-- "tic-1 size adequacy" bst-im: shoot [base 100x100] probe system/view/metrics/dpi bst-sz: 100x100 * system/view/metrics/dpi / 96.0 --assert test-size-match? bst-im bst-sz
96...view hasn't been called once. See: https://github.com/red/red/blob/master/modules/view/view.red#L835dpi value even in CLI-console.dpi value even in CLI-console.view is called the first time...red --cli or the console compiled with needs: view and there's my proper DPIrebol --do "do/args %red.r {-c -t MSDOS 1.red} quit"Red [] probe system/view/metrics/dpiD:\devel\red\red-src\red>1.exe 120
1.red?Red [] probe system/view/metrics/dpilisp C:\Dev\Red>red --cli Compiling compression library... Compiling Red console... --== Red 0.6.4 ==-- Type HELP for starting information. >> system/view/metrics/dpi == 192
-d:D:\devel\red\red-src\red>1.exe root size: 2154, root max: 4126, cycles: 0 root size: 2154, root max: 4126, cycles: 1 root size: 2154, root max: 4126, cycles: 2 *** Runtime Error 1: access violation *** in file: /D/devel/red/red-src/red/datatypes/object.reds *** at line: 97 *** *** stack: red/object/rs-select 0283D264h 0324C930h *** stack: red/error/reduce 0283D284h 0283D264h *** stack: red/error/form 0283D264h 0283D274h 0283D254h -18 *** stack: red/actions/form 0283D264h 0283D274h 0283D254h 0 *** stack: red/actions/form* -1 *** stack: red/natives/prin* false *** stack: red/natives/print* false *** stack: red/stack/throw-error 0283D284h *** stack: red/fire 0 0018FEFCh *** stack: red/actions/get-action-ptr-path 029BF6D8h 7 0049DB14h *** stack: red/actions/eval-path 029BF6D8h 02835204h 00000000h 00000000h false *** stack: red/eval-path 029BF6D8h 02835204h
-r. Seems to me, view isn't the only trigger that inits it.Needs: View into the header of base-self-test.red. But I didn't want to do that because otherwise it'll be impossible to include that script into Linux tests suite (even though it will do nothing useful there, it may be inconvenient to include or exclude it based on the platform). test-size-match so then dpi is still wrong after a few view calls. Consequently, something else triggered it's initialization and it was wrong from the very start.run-test.r and tests/run-all.r, both work with 200% on W8.1.>> trim/with #{00} null
== #{}>> trim #{00}-t Windows (I can't see the output), and even if I change the script name (add/remove 3-4 random letters, or specify not the whole script path but only it's file name) it stops crashing.../window field should always return a window?system/view/VID/styles/bomb: [ template: [ type: 'base size: 50x50 actors: [ on-created: func [f] [ f/color: random white print ["Created!"] ] ] ] ] view [ bomb with [ actors: make actors [ on-down: func [f e] [? e/window/type] ] ] ]
Created! E/WINDOW/TYPE is a word! value: base
>> i: make image! 2x2
== make image! [2x2 #{FFFFFFFFFFFFFFFFFFFFFFFF}]
>> i/1x1
*** Syntax Error: invalid integer! at "i/1x1"
*** Where: do
*** Stack: load
>> i/(1x1)
== 255.255.255.0
>> i/(2x2)
== 255.255.255.0
>> i/(0x0)
== none
>> i/(1x1): 0.0.0
== 0.0.0
>> i
== make image! [2x2 #{000000FFFFFFFFFFFFFFFFFF}]i/1x1 like it recognize i/(1x1), right?pair! argument for repeat as requested by @rgchris years ago: https://github.com/rebol/rebol-issues/issues/1995. But still would like to know other opinions.img: make image! size: 100x100 repeat p size [ img/:p: random 255.255.255 ]
integer accessor)random PAIR is giving 1-based values.image/0x0 gives you the first pixel, and pick image 1 (== first image) the first pixel also, we fail at consistency.i/1x1 like it recognize i/(1x1), right?>> [i/1x1:] ** Syntax error: invalid "time" -- "1x1:" ** Near: (line 1) [i/1x1:]
image/0x0 = image/1, which is inconsistent and confusing for newcomers. Though, a case could be made for it as in "pair indexes are 0-based, while integer indexes are 1-based". That would create an extra obstacle for people learning how to use images in Red. Though, the discussion is open on this, as it's a tight trade-off...>> i: make image! 2x2
== make image! [2x2 #{FFFFFFFFFFFFFFFFFFFFFFFF}]
>> i/1: 0
== 0
>> i/2: 255
== 255
>> i
== make image! [2x2 #{050000050000FFFFFFFFFFFF}]Rebol2 when integer was used, it changed image's alpha value... question is, if it would not be better to use it as a gray color instead? In R3-alpha it was throwing an (improper) error.i/1: to-tuple to-binary 1).i/2: 1.1.1 * 200 is your grayi/2/4: alpha isn't working unfortunatelyargb of a pixel. Not sure about it's portability though. I used it to hold a 2D array of integers in an image. I mean, it was *meant* to change everything, not just alpha ☺argb, but user may want to change just the alpha. How you would do it now?argb ☻x: i/2 x/4: alpha i/2: x or i/2: i/2 * 1.1.1 + (0.0.0.1 * alpha)Red has another easy to fix in-compatibility with Rebol2pair selector respect image size?>> i: make image! 4x4
== make image! [4x4 #{
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFF
>> i/(6x1)
== 255.255.255.0 ;<- should not it be none?Red 0.6.4 for Windows built 11-Jan-2019/5:18:27+03:00 commit #5e37a10)cause-error has been mentioned a few times, but has (or should) a bug be raised to make its basic behaviour conform to that of R2/R3? It seems a bit strange having to wrap simple strings in a redundant block:cause-error 'user 'message ["blah"]
compose from reduce and change the spec.cause-error: func [
{Causes an immediate error throw, with the provided information}
err-type [word!]
err-id [word!]
args [block! string!]
][
args: compose [(:args )]
do make error! [
type: err-type
id: err-id
arg1: first args
arg2: second args
arg3: third args
]
]vector from binary is not working as expected. There should be an error or preferably valid initialization (using the raw data):>> make vector! [integer! 16 2 #{00010002}]
== make vector! [integer! 16 [0 0]] ;<- I would prefer: make vector! [integer! 16 [1 2]]vector <-> binary conversion is a key feature of vector type). And if so, if we should take care of the endianness or keep it on user.vector initialization DSL simply ignores anything following the length info:>> make vector! [integer! 16 2 blabla] == make vector! [integer! 16 [0 0]]
to on vectors, or convert them to binary values. We could start by having @gltewalt begin work on a doc page for vectors, so we know what is expected today.; R2/R3 >> to time! "1:00PM" == 13:00 ; Red >> to time! "1:00PM" == 1:00:00
>> to time! "13:00PM" == none ; R2 == 13:00 ;Red == Error ;R3
time! form, as spec'd: https://doc.red-lang.org/en/datatypes/time.html#_literal_syntaxnone in Rebol if to is used. It lexes as an error there. Same in reverse, for 13:00 to 24:00 with AM attached.dump-reactions function is too limited.system/reactivity/debug?: yes - not so helpful. Could be better if it also shown the memory address of the function relation being called, and that of the object that triggered it. Although I suspect GC can relocate those, so there needs to be another entity identification method...system/reactivity/debug?: yes gives you already (just a object event level view though). If you hook to it, remember that existing Red functions have been compiled in the environment provided by the runtime library, so you can't directly change such code, you have to reconstruct the functions from their spec + body blocks.-== Red 0.6.4 ==-- Type HELP for starting information. >> about Red 0.6.4 for Linux built 11-Jan-2019/3:18:27+01:00 commit #5e37a10 >> parse "" [any x:] == true >> parse " " [any x:] *** Runtime Error 1: access violation *** at: 08067E63h
*** Runtime Error 98: assertion failed *** in file: /D/devel/red/red-src/red/runtime/parse.reds *** at line: 563 *** *** stack: red/parser/loop-token 00000062h 00465616h 1328 1637192 00000001h 16 7 *** stack: red/parser/loop-token 02A30C90h 02C67714h 0 -1 0018FBC0h 0 0 *** stack: red/parser/process 02A30C90h 028304A4h 0 0 02830484h *** stack: red/natives/parse* false -1 0 -1 *** stack: red/interpreter/eval-arguments 02A105C4h 02C66FA4h 02C66FA4h 00000000h 00000000h *** stack: red/interpreter/eval-code 02A105C4h 02C66F84h 02C66FA4h false 00000000h 00000000h 02A105C4h *** stack: red/interpreter/eval-expression 02C66F84h 02C66FA4h false false false *** stack: red/interpreter/eval 02830464h true *** stack: red/natives/catch* true 1 *** stack: ctx473~try-do 00B61C8Ch *** stack: ctx473~do-command 00B61C8Ch *** stack: ctx473~eval-command 00B61C8Ch *** stack: ctx473~run 00B61C8Ch *** stack: ctx473~launch 00B61C8Ch
parse " " [any x:] ; == false
Red 0.6.4 for Windows built 22-Nov-2018/1:40:38+01:00 commit #755eb94 and Red 0.6.4 for Windows built 22-Nov-2018/1:40:38+01:00 commit #755eb94 work.red-26dec18-7369fa2e, gui-console-2019-1-11-8330 and gui-console-2019-1-1-51753 doesn't work.is~ function...word!-s of the same reactor, but ignores get-word!s. So [x: 1 y: is [x * 2]] will work but [x: 1 y: is [:x * 2]] won't. Is it by design?>> a: make reactor! [x: 1] >> b: make reactor! [x: 1 y: is [a/x * 2]]
react (that actually sets 'y') and one from is (that's just a dead weight). It would've made sense to create a reaction for a/:x(doesn't happen) but not for a/x(does happen).>> a: make reactor! [x: 1]
>> b: make reactor! [y: is [[3] 2 * a/x]]
== make object! [
y: 3
]event/key names for horizontal bar while clicking on vertical:view [panel with [flags: 'scrollable] on-scroll [probe event/key]]
? or, ? not etc. works but ? is doesn't *** Script Error: is operator is missing an argumentis takes its left operand literally.>> ? + also works.>> f: make op! func ['a b] [42] == make op! [['a b]] >> ? f *** Script Error: f operator is missing an argument
system/catalog/accessors) also as a field argument of reflect action? Or what are your future plans for reflect?scrollable works nicely with some other faces I have tried, e.g. rich-text and base.>> make-dir %test == %test/ >> read %test/ == [] >> read %test *** Access Error: cannot open: %test *** Where: read *** Stack:
>> read %./ == [%.appveyor.yml %.editorconfig %.git/ %.github/ %.gitignore-sample %.travis.yml %.vs/ %boot.red %bridges/... >> read %. == [%.appveyor.yml %.editorconfig %.git/ %.github/ %.gitignore-sample %.travis.yml %.vs/ %boot.red %bridges/...
%. or %.. would only be able to refer to a directory (I don't think files with those names would be allowed at least), but this behavior seems inconsistent with the above example>> dir? %. == false >> dir? %./ == true >>
dir? is just checking for / char at tail, not if it really is existing directory:dir?: func [{Returns TRUE if the value looks like a directory spec} file [file! url!]][#"/" = last file]dir? behavior can be different because it doesn't perform any access to checkdir? and special cases. It can easily check for those.is is dated 3 years ago https://github.com/red/red/blame/master/environment/reactivity.red. Same for the tests https://github.com/red/red/blame/master/tests/source/units/reactivity-test.redis questions](https://gitter.im/red/bugs?at=5c40804995e17b452566f180), some react questions:react initially evaluates every reaction (block or function) **once for every input of it**. It's rather inefficient, no? If there's a justification for this, let's document it. If it's an oversight, let's fix it.react when used with a block [supports deeply nested paths](https://github.com/red/red/blob/5e37a10f19f9a4f27d0fdc34e8c58797a0763824/environment/reactivity.red#L325). I suppose it is for constructs like a/(b/x)/y. Shouldn't react/link branch support it too?refinement! is not part of any-word! or is it just oversight?Rebols:>> any-word? /ref == true
Red it is false.issue! cannot be used as a key of map!:>> make map! [a 1 b: 2 :c 3 'd 4 "a" 7 <b> 8 9 9 %f 10]
== #(
a: 1
b: 2
c: 3
d: 4
"a" 7
<b> 8
9 9
%f 10
)>> make map! [#is 11] *** Script Error: issue! type is not allowed here *** Where: make *** Stack:
a[] or (){} (@meijeru).latest 6.0.3 gui console? Red 0.6.4 for Windows built 11-Jan-2019/5:18:27+03:00 commit #5e37a10 and it works.all-word!, which includes refinement! and issue!. It's possible the word typeset names could change, but we need a good one for the base word types then.*** Runtime Error 1: access violation *** in file: /D/devel/red/red-src/red/modules/view/backends/windows/gui.reds *** at line: 143 *** *** stack: gui/get-node-facet 00000000h 0 *** stack: gui/get-facet 0050AD3Ch 0 *** stack: gui/process-command-event 003B003Ah 273 16777216 14484762 *** stack: gui/WndProc 003B003Ah 273 16777216 14484762
foreach f fs pick [ [index-file f] [unless find f "tests/" [index-file f]] ] config/include-tests?
*** Compilation Error: expected a block for FOREACH-BODY instead of word! value
*** in file: C:\Users\Eigenaar\Projects\Red\IDEs\code-viewer\red-codex.red
*** near: [pick [
[index-file f]
[unless find f "tests/" [index-file f]]
] config/include-tests?]
> Terminated with exit code 1.-e. It's hopeless :) Even if you succeed it will just do nothing or crash. I'm using red -r -e redcodex.red to compile it. I also did a little benchmark to compare source code parsing speed with -r and -r -e and the former is only like 12% faster, so I abandoned that idea.loop - I fed it with a dynamic block, and @dockimbel said it's a known limitation not worth the trouble reporting it.analyze func is.red.r is located, with also glob.red being present there?needs: view to https://github.com/red/red/blob/master/environment/console/CLI/console.red and save it as console-view.red, then compile it in debug mode: rebol -qws --do "do/args %red.r {-r -d %environment/console/CLI/console-view.red} quit" and then run the script as cmd /k console-view redcodex.red so when it crashes it at least will leave you a hint - why*** Compilation Error: expected a block for FOREACH-BODY instead of word! value-e, nothing happened when executed (no output at all)calloc isn't even imported by Red runtime. Do you mean MacOS zero-fills the RAM requested by malloc?mmap does that...allocate itself is an imported malloc. So if you used it and got zero memory you might just have been lucky that's all ;)Red/System [
title: {graph datatype}
]
property!: alias struct! [
propKey [ c-string! ]
propValue [ c-string! ]
type [ byte! ]
nextPropId [ property! ]
]
relationship!: alias struct! [
firstNode [ struct! [
nextRelId [ relationship! ]
lastRelId [ relationship! ]
nextPropId [ property! ]
lastPropId [ property! ]
extra [ byte! ]
] ]
secondNode [ struct! [
nextRelId [ relationship! ]
lastRelId [ relationship! ]
nextPropId [ property! ]
lastPropId [ property! ]
extra [ byte! ]
] ]
firstPrevRelId [ relationship! ]
firstNextRelId [ relationship! ]
secondPrevRelId [ relationship! ]
secondNextRelId [ relationship! ]
nextPropId [ property! ]
lastPropId [ property! ]
directed [ logic! ]
]
node!: alias struct! [
nextRelId [ relationship! ]
lastRelId [ relationship! ]
nextPropId [ property! ]
lastPropId [ property! ]
extra [ byte! ]
]
graph: context [
add-property-to-node: func [ n [ node! ] propKey [ c-string! ] propValue [ c-string! ] type [ byte! ] return: [ property! ] /local lp ][
lp: as property! allocate size? property!
lp/propKey: propKey
lp/propValue: propValue
lp/type: type
if (as integer! n/lastPropId) <> 0 [ ; there is already a previous property in the node
n/lastPropId/nextPropId: lp
n/lastPropId: lp
]
if (as integer! n/nextPropId) = 0 [ ; there is no previous property in the node
n/nextPropId: lp
n/lastPropId: lp
]
lp
]
new-node: func [ return: [ node! ] /local n p ] [
n: as node! allocate size? node!
n/nextRelId: as relationship! 0
n/lastRelId: as relationship! 0
n/nextPropId: as property! 0
n/lastPropId: as property! 0
n
]
add-property-to-relationship: func [ r [ relationship! ] propKey [ c-string! ] propValue [ c-string! ] type [ byte! ] return: [ property! ] /local lp ][
lp: as property! allocate size? property!
lp/propKey: propKey
lp/propValue: propValue
lp/type: type
if (as integer! r/lastPropId) <> 0 [ ; there is already a previous property in the relationship
r/lastPropId/nextPropId: lp
r/lastPropId: as property! lp
]
if (as integer! r/nextPropId) = 0 [ ; there is no previous property in the relationship
r/nextPropId: lp
r/lastPropId: lp
]
lp
]
new-relationship: func [ firstNode [ node! ] secondNode [ node! ] directed [ logic! ] return: [ relationship! ] /local r ] [
r: as relationship! allocate size? relationship!
r/firstNode: firstNode
r/secondNode: secondNode
r/directed: directed
if (as integer! firstNode/lastRelId) <> 0 [ ; there is already a previous relationship in the first node
r/firstPrevRelId: firstNode/lastRelId
firstNode/lastRelId/firstNextRelId: r
firstNode/lastRelId: r
]
if (as integer! firstNode/nextRelId) = 0 [ ; there is no previous relationship in the first node
firstNode/nextRelId: r
firstNode/lastRelId: r
]
if (as integer! secondNode/lastRelId) <> 0 [ ; there is already a previous relationship in the second node
r/secondPrevRelId: secondNode/lastRelId
secondNode/lastRelId/secondNextRelId: r
secondNode/lastRelId: r
]
if (as integer! secondNode/nextRelId) = 0 [ ; there is no previous relationship in the second node7
secondNode/nextRelId: r
secondNode/lastRelId: r
]
r
]
delete-node: func [ n [ node! ] ][
; delete each property from the node
; delete each relation to/from the node
]
delete-relationship: func [ r [ relationship! ] n1 [ node! ] n2 [ node! ] ][
; delete each property from the relationship
free as byte-ptr! r
]
delete-property: func [ p [ property! ] n [ node! ] ][
; delete the property 'p' and redirect the previous property's nextPropId and the node's lastPropId
free as byte-ptr! p
]
probe-node: func [ n [ node! ] /local p r outgoing incoming ][
p: n/nextPropId
print [ "node: " n lf "properties: " lf ]
while [ (as integer! p) <> 0 ][
print [ p " > " p/propKey " : " p/propValue " : " as integer! p/type lf ]
if p = n/lastPropId [ break ]
p: p/nextPropId
]
r: n/nextRelId
if (as integer! r) <> 0 [
while [ true ][
if n = r/firstNode [
print [ lf " -> outgoing relationship: " r lf "1st node: " r/firstNode " 2nd node: " r/secondNode " directed: " r/directed lf
"1st PrevRel: " r/firstPrevRelId " 1st NextRel: " r/firstNextRelId lf
"2nd PrevRel: " r/secondPrevRelId " 2nd NextRel: " r/secondNextRelId lf
"properties: " r/nextPropId lf
]
p: r/nextPropId
while [ true ][
print [ p " > " p/propKey " : " p/propValue " : " as integer! p/type lf ]
if p = r/lastPropId [ break ]
p: p/nextPropId
]
]
if r/firstNode/lastRelId = r [ break ]
if (as integer! r/firstNextRelId) = 0 [ break ]
r: r/firstNextRelId
]
r: n/nextRelId
while [ true ][
if n = r/secondNode [
print [ lf " <- incoming relationship: " r lf "1st node: " r/firstNode " 2nd node: " r/secondNode " directed: " r/directed lf
"1st PrevRel: " r/firstPrevRelId " 1st NextRel: " r/firstNextRelId lf
"2nd PrevRel: " r/secondPrevRelId " 2nd NextRel: " r/secondNextRelId lf
"properties: " r/nextPropId lf
]
p: r/nextPropId
while [ true ][
print [ p " > " p/propKey " : " p/propValue " : " as integer! p/type lf ]
if p = r/lastPropId [ break ]
p: p/nextPropId
]
]
if r/secondNode/lastRelId = r [ break ]
if (as integer! r/secondNextRelId) = 0 [ break ]
r: r/secondNextRelId
]
]
]
]
n1: graph/new-node
graph/add-property-to-node n1 "name" "starting node" as-byte 1
graph/add-property-to-node n1 "second property" "pp" as-byte 12
n2: graph/new-node
graph/add-property-to-node n2 "name" "ending node" as-byte 4
graph/add-property-to-node n2 "second property" "qq" as-byte 52
r1: graph/new-relationship n1 n2 no
graph/add-property-to-relationship r1 "number" "1" as-byte 2
graph/add-property-to-relationship r1 "number" "2" as-byte 2
r2: graph/new-relationship n2 n1 yes
graph/add-property-to-relationship r2 "number" "3" as-byte 2
graph/add-property-to-relationship r2 "number" "4" as-byte 2
r3: graph/new-relationship n2 n1 no
graph/add-property-to-relationship r3 "number" "5" as-byte 2
graph/add-property-to-relationship r3 "number" "6" as-byte 2
print [ lf "---" lf lf ]
graph/probe-node n1
print [ lf "---" lf lf ]
graph/probe-node n2
print [ lf "---" lf "n1/nextRel/firstNextRelId/firstNode" lf lf ]
graph/probe-node n1/nextRelId/firstNextRelId/firstNode
free as byte-ptr! n1
free as byte-ptr! n2
free as byte-ptr! r1
free as byte-ptr! r2
free as byte-ptr! r3allocate indeed... Well, if you're curious @ericguedespinto you can allocate a big chunk of RAM and scan it for non-zero bytes, to determine if you were lucky or MacOS' malloc is really special. If not, you can just use zerofill func or allocate-virtual from R/S runtime to ensure it's zero filled.Red/System [
title: {graph datatype}
]
property!: alias struct! [
propKey [ c-string! ]
propValue [ c-string! ]
nextPropId [ property! ]
]
node!: alias struct! [
nextPropId [ property! ]
lastPropId [ property! ]
]
graph: context [
add-property-to-node: func [ n [ node! ] propKey [ c-string! ] propValue [ c-string! ] return: [ property! ] /local lp ][
lp: as property! allocate size? property!
lp/propKey: propKey
lp/propValue: propValue
if (as integer! n/lastPropId) <> 0 [ ; there is already a previous property in the node
n/lastPropId/nextPropId: lp
n/lastPropId: lp
]
if (as integer! n/nextPropId) = 0 [ ; there is no previous property in the node
n/nextPropId: lp
n/lastPropId: lp
]
lp
]
new-node: func [ return: [ node! ] /local n p ] [
n: as node! allocate size? node!
;n/nextPropId: as property! 0 ; add it to work on Win
;n/lastPropId: as property! 0
n
]
probe-node: func [ n [ node! ] /local p r outgoing incoming ][
p: n/nextPropId
print [ "node: " n lf "properties: " lf ]
while [ (as integer! p) <> 0 ][
print [ p " > " p/propKey " : " p/propValue lf ]
if p = n/lastPropId [ break ]
p: p/nextPropId
]
]
]
n1: graph/new-node
graph/add-property-to-node n1 "name" "starting node"
graph/add-property-to-node n1 "second property" "pp"
print [ lf "---" lf lf ]
graph/probe-node n1
free as byte-ptr! n1allocate is malloc so it wasn't designed to zero-fill the chunk. So it's totally expected for your code to fail ☺allocate-virtual and zerofill belong to Red memory allocator, not to R/S runtime.as node! set-memory allocate size? node! as byte! 0 size? node!
allocate-virtual and zerofill are functions in %runtime/allocator.reds. allocate-virtual is only called from within %runtime/allocator.reds; zerofill is not called from within the toolchain (?)red-concordance and grep utilities.fill 0 is used instead?cause-error change ticket, which resulted in CI failures and access violation errors. Odd. Backed out changes. Same errors. Thinking I was somehow forked up, I did a fresh clone of red/red and get a different fault. do %tests/run-all.r (from Rebol, obviously) fail with an access violation in run-all-interp at test 2077:--test-- "#2077" ; NOTE: shouldn't override the `sum` func, or next tests using it may fail sum2077: function [list [block!]] [ total: 0 foreach i list [total: i + total] total ] r2077: make reactor! [l: [3 4 5 6] total: is [sum2077 l]] r2077/l: append copy r2077/l 5 --assert not error? try [append r2077/l 5] unset [sum2077 r2077]
qt-verbose flag. :^)R3-alpha it was not normalized:>> m: make map! [a 1 b: 2 :c 3 'd 4 #e 5 /f 6 "a" 7 <b> 8 9 9 #"c" 10]
== make map! [
a 1
b: 2
:c 3
'd 4
#e 5
/f 6
"a" 7
<b> 8
9 9
#"c" 10
]>> m/(quote a) == 1 >> m/(quote 'a) == 1 >> m/(quote :a) == 1
Ren-C's todays behaviour:>> m: make map! [a: 1 :a 2]
== make map! [
a: 1
:a 2
]>> make map! [#a 1]
*** Script Error: issue! type is not allowed here
*** Where: make
*** Stack:
>> make map! [:a 1]
== #(
a: 1
)any-word!: make typeset! [word! set-word! get-word! lit-word!] ;-- any bindable word all-word!: union any-word! make typeset! [refinement! issue!] ;-- all types of word nature
issue! as a key is useful in dialects... if you want fast lookup of preprocessed action for example (not that I would do that, but I can imagine that).string! bindable?map! keys?>> make map! [#aa 1]
*** Script Error: issue! type is not allowed here
*** Where: make
*** Stack:
>> make map! ["aa" 1]
== #(
"aa" 1
)to word! issue before using it as key. But why./help room? It's more suggestion than bug.map! type rests already has the code for both Red objects and Red blocks as keyspreprocess-key: func [ key [red-value!] ][ switch TYPE_OF(key) [ TYPE_WORD TYPE_GET_WORD TYPE_SET_WORD TYPE_LIT_WORD [key/header: TYPE_SET_WORD] ;-- convert any-word! to set-word! TYPE_BINARY TYPE_STRING TYPE_FILE TYPE_URL TYPE_TAG TYPE_EMAIL [_series/copy as red-series! key as red-series! key null yes null] TYPE_INTEGER TYPE_CHAR TYPE_FLOAT TYPE_DATE TYPE_PERCENT TYPE_TUPLE TYPE_PAIR TYPE_TIME [0] default [fire [TO_ERROR(script invalid-type) datatype/push TYPE_OF(key)]] ] ]
>> h: make hash! reduce [make object! [] 123 make object! [] 234 make object! [] 345] >> select h object [] == none >> select h object [] == 123 >> select h object [] == none >> select h object [] == none >> select h object [] == none >> select h object [] == none >> select h object [] == 123 >> select h object [] == none >> select h object [] == none >> select h object [] == none >> select h object [] == none >> select h object [] == 345 >> select h object [] == 345
>> probe about Red 0.6.4 for Linux built 17-Dec-2018/9:23:46+01:00
>> probe about Red 0.6.4 for Linux built 24-Jan-2019/13:53:52+01:00
>> select h object [] == 123 >> select h object [] == none >> select h object [] == 345 >> select h object [] == 234 >> select h object [] == 123 >> select h object [] == none >> select h object [] == 345 >> select h object [] == 234
h: ... string a few times, wait a few secs, and hope :)h➜ red git:(master) ✗ red --== Red 0.6.4 ==-- Type HELP for starting information. >> h: make hash! reduce [make object! [] 123 make object! [] 234 make object! [] 345] == make hash! [make object! [] 123 make object! [] 234 make object! [] 345] >> loop 100 [prin [select h object [] space] h] none none 123 none none none 234 none none none 345 none none none none none none none 123 none none none 234 none none none 345 none none none none none none none 123 none none none 234 none none none 345 none none none none none none none 123 none none none 234 none none none 345 none none none none none none none 123 none none none 234 none none none 345 none none none none none none none 123 none none none 234 none none none 345 none none none none none none none 123 none == make hash! [make object! [] 123 make object! [] 234 make object! [] 345]
>> loop 100 [prin [select h object [] space] h] none none none none none none 123 none none none 234 none none none 345 none none none none none none none 123 none none none 234 none none none 345 none none none none none none none 123 none none none 234 none none none 345 none none none none none none none 123 none none none 234 none none none 345 none none none none none none none 123 none none none 234 none none none 345 none none none none none none none 123 none none none 234 none none none 345 none none none none none == make hash! [make object! [] 123 make object! [] 234 make object! [] 345]
[] = noneprint is slow. loop 200 [either none = x: select h object [][print x][print "strange"]]hprint it to trigger the bug>> loop 200 [either none = x: select h object [][probe x][print "strange"]] none strange strange none none none none strange strange (...)
>> loop 200 [either (select h object []) = none [][print "strange"]] strange strange strange strange strange [..] strange strange strange strange strange >> h == make hash! [make object! [] 123 make object! [] 234 make object! [] 345] >> loop 200 [either (select h object []) = none [][print "strange"]] >>
>> h == make hash! [make object! [] 123 make object! [] 234 make object! [] 345] >> loop 1000 [if (v: select h object []) [print v]] 123 234 == none >>
recycle/off it fails only once and then it's always none.>> recycle/off >> loop 2000 [if (v: select h object []) [print v]] 345 345 123 345 345 123 234 123 234 == none >> loop 2000 [if (v: select h object []) [print v]] 234 234 345 345 234 234 123 345 345 345 234 == none >> loop 2000 [if (v: select h object []) [print v]] 345 123 345 234 345 123 345 == none
>> loop 100000 [if (v: select h object []) [print v]] == none >> loop 100000 [if (v: select h object []) [print v]] == none >> loop 100000 [if (v: select h object []) [print v]] == none >> loop 1000000 [if (v: select h object []) [print v]] == none
>> recycle/off >> recycle/off >> recycle/off >> loop 2000 [if (v: select h object []) [print v]] == none >> loop 2000 [if (v: select h object []) [print v]] == none >> loop 2000 [if (v: select h object []) [print v]] == none >> loop 2000 [if (v: select h object []) [print v]] == none >> loop 2000 [if (v: select h object []) [print v]] == none >> loop 2000 [if (v: select h object []) [print v]] == none >> loop 2000 [if (v: select h object []) [print v]] == none
>> recycle/off >> recycle/off >> recycle/off >> loop 2000 [if (v: select h object []) [print v]] 234 234 345 123 123 123 234 123 123 == none >> loop 2000 [if (v: select h object []) [print v]] 123 234 123 345 345 == none >> loop 2000 [if (v: select h object []) [print v]] 234 123 345 == none >> loop 2000 [if (v: select h object []) [print v]] 234 123 == none >> loop 2000 [if (v: select h object []) [print v]] == none >> loop 2000 [if (v: select h object []) [print v]] == none >>
>> recycle/off >> loop 2000 [if (v: select h object []) [print v]] 234 123 234 234 123 345 == none >> loop 2000 [if (v: select h object []) [print v]] 345 345 234 234 345 123 345 234 345 == none >> loop 2000 [if (v: select h object []) [print v]] 234 234 234 123 123 234 234 234 345 234 345 345 == none >> loop 2000 [if (v: select h object []) [print v]] 123 345 123 234 123 234 234 345 345 234 == none >> loop 2000 [if (v: select h object []) [print v]] 234 123 345 345 345 234 234 234 345 345 == none >> loop 2000 [if (v: select h object []) [print v]] 123 345 123 345 345 == none >> loop 2000 [if (v: select h object []) [print v]] 345 345 234 234 345 123 234 == none >> loop 2000 [if (v: select h object []) [print v]] 123 234 == none >> loop 2000 [if (v: select h object []) [print v]] 123 234 == none >> loop 2000 [if (v: select h object []) [print v]] 234 123 == none >> loop 2000 [if (v: select h object []) [print v]] 345 123 == none >> loop 2000 [if (v: select h object []) [print v]] 234 123 234 == none >> loop 2000 [if (v: select h object []) [print v]] 123 123 123 234 == none >> loop 2000 [if (v: select h object []) [print v]] 345 123 == none >> loop 2000 [if (v: select h object []) [print v]] 345 == none >> loop 2000 [if (v: select h object []) [print v]] == none >> loop 2000 [if (v: select h object []) [print v]] 123 123 == none >> loop 2000 [if (v: select h object []) [print v]] == none >> loop 2000 [if (v: select h object []) [print v]] == none >> loop 2000 [if (v: select h object []) [print v]] 123 == none >> loop 2000 [if (v: select h object []) [print v]] == none >> loop 2000 [if (v: select h object []) [print v]] == none >> loop 2000 [if (v: select h object []) [print v]] 345 234 == none >> loop 2000 [if (v: select h object []) [print v]] == none >> loop 2000 [if (v: select h object []) [print v]] == none >> loop 2000 [if (v: select h object []) [print v]] == none >> loop 2000 [if (v: select h object []) [print v]] == none >> loop 2000 [if (v: select h object []) [print v]] == none >> loop 2000 [if (v: select h object []) [print v]] == none >> loop 2000 [if (v: select h object []) [print v]] == none >> loop 2000 [if (v: select h object []) [print v]] == none >>
>> recycle/on >> loop 10000 [if (v: select h object []) [print v]]
none in CLI console on Win7>> read https://gitlab.com/help *** Access Error: cannot connect: https://gitlab.com/help reason: timeout *** Where: read *** Stack:
print "Warning: Virus detected" :smirk: to-local-file/full problem reproduced on Win10. Would be good to see what in the system needs that to be native (R/S). It uses to-local-path in file!.store out of the function analyze since the compiler -- unlike the interpreter -- cannot cope with nested functions. I will now update the gist.>> view [text "one^/two^/three" 200 red] >> view [text "one^/two^/three" 200 red white]
Red 0.6.4 for Windows built 11-Jan-2019/5:18:27+03:00 commit #5e37a10)state facet yet). This function's logic is a labyrinth right now ☺invalid function definition error when used in function spec.TYPE_BLOCK is accepted in spec checking function (validate), see this line:>> f: function [5] [a: 1 b: 2] *** Script Error: invalid function definition: 5 ;<--- expected behavior >> f: function [[x y]] [a: 1 b: 2] == func [[x y] /local a b][a: 1 b: 2] >> ? f Func spec couldn't be parsed, may be malformed. func [[x y] /local a b][a: 1 b: 2]
function [x y [string!]]func [[string!]][] is allowed>> x: make vector! [1 2 3 4 5] == make vector! [1 2 3 4 5] >> y: make vector! [6 7 8 9 10] == make vector! [6 7 8 9 10] >> x // y *** Script Error: absolute does not allow vector! for its value argument *** Where: absolute *** Stack: mod
Red 0.6.4 for Windows built 27-Jan-2019/3:20:41-07:00 commit #e7c4603// accepts vectormod and modulo are a total mess that requires a rewrite from scratch, but it wasn't done because the plan is more than that: https://github.com/red/red/issues/2433vector is even more of a mess because it's practically a gun armed with bullets firing backwards... like can you guess the result of v: make vector! [5 5 5] 1 - v * v - 1 without running it in console?>> 1 - make vector! [16 16 16] == make vector! [15 15 15]
+ - * / %shoot-me-in-the-foot DSL, preferably in R/S, totally isolated from the main language. Nobody expects 1 - x and x - 1 to give the same result. Every function out there might test it's input on conditions like a - 1 < b and will be broken by such math rules misuse.>> v: make vector! [5 5 5] == make vector! [5 5 5] >> v == make vector! [5 5 5] >> 1 - v * v - 1 == make vector! [15 15 15] >> v == make vector! [4 4 4]
1 - v part. But the problem is, that I look at vector as highly optimized LARGE array of numbers and when I do operation on it, I don't want to copy of the array on each op. a - b to be done in place (modifying a)? or a way to fill the vector with a given constant value?matrix! or other vector type variant, which will copy itself before modifying.v * v creates a new vector and v - 1 modifies, than it is inconsistency. But I think that vector is deep down in the todo list.1 - v * v - 1 makes any sense.>> v * 10 == make vector! [40 40 40]
>> forall v [v/1: v/1 * 10] v == make vector! [40 40 40]
copy manually:>> v: make vector! [4 4 4] == make vector! [4 4 4] >> w: 10 * copy v == make vector! [40 40 40] >> v == make vector! [4 4 4]
1 - v * v - 1 is just a simplistic joke of course. In real life you'll probably have a longer expression, and will probably want to apply fast functions like sin or log in place as well.>> 1 - make vector! [16 16 16] == make vector! [15 15 15]
1 - 16 == 15[-4 -4 -4], from Boris's example, which still gives the same end result. v not only the expression? v. This is corroborated by:>> v: make vector! [5 5 5] 1 - v v: v * v - 1 == make vector! [15 15 15] >> v == make vector! [15 15 15]
set with block?>> b: 1 set [A B] reduce [4 ()] == [4 unset] >> b *** Script Error: b has no value *** Where: catch *** Stack:
word directly?>> b: 1 set 'b () *** Script Error: b needs a value *** Where: set *** Stack: >> b == 1
b in the first case (without throwing an error)?set/some is used.Set/any is interesting. Clearly good for Rebol compatibility, and also to catch unintentional unsets. The easiest change is probably to have set* also check if block args contain any unset! values. Otherwise it will have a ripple effect to object/set-many and set-many internally. I don't think handling it at the set entry point will be too limiting, and will make it an easy fix.Red> sort/all/compare [1 2 3 4 5 6] func [a b] [5] ; == [1 2 3 4 5 6] ; integer 5 treated as false Red> sort/all/compare [1 2 3 4 5 6] func [a b] [5.4] ; == [1 2 3 4 5 6] ; float also treated as false
[2 3 4 5 6 1])>> sort/all/compare [1 4 6 3 2 5] func [a b] [a - b] == [1 2 3 4 5 6]
>> sort/all/compare [1 4 6 3 2 5] func [a b] [a - b] == [6 5 4 3 2 1]
view [button "Text" %head.png [face/image: %tail.png]]
view [button "Text" %head.png [face/image: none]]
probe face/image, but it doesn't display it. Also had no luck with defered updating.load the image first... but that doesn't work either:view [button "Text" %head.png [face/image: load/as %tail.png 'png]]
button too, right? If so, shall I open an issue?Red []
#include %environment/console/CLI/input.red
binary-url: https://static.red-lang.org/dl/auto/win/red-latest.exe
binary-name: does [to-file append ask "Enter your prefered Red executable name: " ".exe"]
update-binary: func [name url][
if exists? name [call/shell form reduce ["rename" name append name ".old"]]
write/binary name read/binary url
]
compile-consoles: does [
call/console {red}
call/console {red --cli}
]
update-binary binary-name binary-url
compile-consolesobject/rs-select. I suspect that it has something to do with hashtable, as it's used for symbol searching in contexts.object/rs-select with debugging prints and see where it goes south. Most of it are typecasts with asserts, and the only suspicious [line](https://github.com/red/red/blob/master/runtime/datatypes/object.reds#L98) is the one where symbol lookup happens.Date/Time: 2019-02-19 03:29:08 +0530 End time: 2019-02-19 03:29:10 +0530 OS Version: Mac OS X 10.14.3 (Build 18D109) Architecture: x86_64h Report Version: 27 Data Source: Stackshots Shared Cache: 0x1f672000 E4B3A94D-55C0-393C-A126-2603E9F8FC4E Shared Cache: 0 0822F2B8-73B6-3640-8E91-04395E27F608 Command: console-2019-2-4-67544 Path: /usr/lib/dyld Version: ??? (???) PID: 609 Event: hang Duration: 1.70s Steps: 17 (100ms sampling interval) Hardware model: MacBookPro14,3 Active cpus: 8 Time Awake Since Boot: 24000s Time Since Wake: 13000s Fan speed: 2155 rpm
recycle/off)?kill -9 should blow up any process. Kill by itself only sends an interrupt IIRC. -9 sends kill. until [print now wait 300 false] seems to cause the macOS GUI console to lock up.Force Quit the instancerepeat i 200 [ print i wait i ]wait 300 is 5 minutes of wait! in a single threaded application that's the very definition of lock updo-events/no-wait call inbetweenbitset! is using zero-based indexing, is it by design?>> b: make bitset! 2#{10000001}
== make bitset! #{81}
>> b/1
== false
>> b/0
== true
>> b/7
== truecurves: [line curv curve qcurv qcurve] view probe collect [ foreach ctype curves [ keep compose/deep [ base 250x250 draw [ scale 10 10 pen linear cyan purple shape [(ctype) 5x5 20x5 20x20 5x20] ] ] ] ]
curves: [line curv curve qcurv qcurve]
view probe collect [
foreach ctype curves [
keep compose/deep [
base 250x250 draw [
scale 10 10 pen linear cyan purple
shape [move 5x5 (ctype) 20x5 20x20 5x20]
]
]
]
]line they always start from 0x0 it seemscurv and qcurve?curv and qcurv missing (unsupported probably, can't even find the docs for R2 shape dialect)\tests\shape-test.redview [box 650x250 draw [translate 10x100 shape [curve 100x100 200x100 300x0 curv 500x-100 600x0 move 0x0]]]
*** Access Error: cannot open: %-psn_0_430185 *** Where: read *** Stack: --== Red 0.6.4 ==-- Type HELP for starting information.
*** Access Error: cannot open: %-psn_0_2032112 *** Where: read *** Stack: --== Red 0.6.4 ==-- Type HELP for starting information.
view compose/deep [
rich-text 400x200 draw [
text 10x10 (rt: rtd-layout [i/blue ["Hello " red/b [font 24 "Red " /font] "World! Lalalalala"]])
line-width 5 pen gold
line ; Let's draw line under words using a pair of above helper functions
(as-pair 10 h: 10 + rich-text/line-height? rt 1) ; Starting-point y -> 10 + line-height
(as-pair 10 + pick size-text rt 1 h) ; End-point x -> 10 + length-of-text-size
]
]rtd-layout creates a face with default size. You may have to adjust it before using, e.g.:rt: rtd-layout [i/blue ["Hello " red/b [font 24 "Red " /font] "World! Lalalalala"]]
rt/size/x: 380
view compose/deep [
rich-text 400x200 draw [
text 10x10 (rt)
line-width 5 pen gold
line ; Let's draw line under words using a pair of above helper functions
(as-pair 10 h: 10 + rich-text/line-height? rt 1) ; Starting-point y -> 10 + line-height
(as-pair 10 + pick size-text rt 1 h) ; End-point x -> 10 + length-of-text-size
]
]view compose/deep [
rich-text 400x200 draw [
text 10x10 (rt: first layout/only [rich-text 380x180 data [i/blue ["Hello " red/b [font 24 "Red " /font] "World! Lalalalala"]]])
line-width 5 pen gold
line ; Let's draw line under words using a pair of above helper functions
(as-pair 10 h: 10 + rich-text/line-height? rt 1) ; Starting-point y -> 10 + line-height
(as-pair 10 + pick size-text rt 1 h) ; End-point x -> 10 + length-of-text-size
]
]>> save s: #{} 'junk
*** Script Error: suffix? does not allow binary! for its path argument
*** Where: suffix?
*** Stack: save suffix?
>> save s: "" 'junk
== "#{6A756E6B}"
>> save %tmpfil none type? load %tmpfil
== word!
>> save %tmpfil [1] load %tmpfil
== 1/next and /trap. Load is a mezz, but a use-case document would be great, as this is a powerful tool in our arsenal. Maybe @toomasv or others who have done some step-tracing tools can weigh in.mold/all is for./all is for. We have both save and write as well. Mold doesn't know how you're going to use its result.>> save %tmpfil [1] load %tmpfil
== 1 ; in R2 = [1]
>> save s: "" 'junk
== "#{6A756E6B}" ; why on earth a binary is put into a string??Save is a mezz, so we can easily analyze. The value is molded, then converted to binary. Rebol couldn't save in to a string, and there's another wrinkle. Saving to files or urls overwrites prior content, but appends to string and binary values.save could've had an /only refinement for symmetry with mold/only>> save/all %tmpfil [1] load %tmpfil == 1 ; no /all = wrong on blocks >> save/all %tmpfil 1 load/all %tmpfil == [1] ; with /all = wrong on values
/trap can be made to work with /next, but it seems mostly to be useful without it, as it overrides /next refinement's usual semantics. I don't think it was meant to be used with /next. To trap errors with /next without overriding its semantics something like this can be used:>> s: "1 2 3bad"
== "1 2 3bad"
>> either error? n: try [load/next s 's]['error][n]
== 1
>> either error? n: try [load/next s 's]['error][n]
== 2
>> either error? n: try [load/next s 's]['error][n]
== error
>> to-block n
== [make error! [
code: 200
type: 'syntax
id: 'invalid
arg1: integer!
arg2: "3bad".../next with /trap, something like following can be used:>> s: "1 2 3bad"
== "1 2 3bad"
>> s: second load/next/trap s 'n either error? n/3 ['error][n/1/1]
== 1
>> s: second load/next/trap s 'n either error? n/3 ['error][n/1/1]
== 2
>> s: second load/next/trap s 'n either error? n/3 ['error][n/1/1]
== error
>> to-block n/3
== [make error! [
code: 200
type: 'syntax...offset-to-caret function (in platform.red) for area widget as used by @toomasv in its wonderful editor.red. offset-to-caret function uses directly text-box-metrics which seems irrelevant for area widget. This is working for Windows since I guess the API should be the same for both RedBase and RedArea classes. Of course I can intercept the type of widget and insert the right code inside OS-text-box-metrics (it is what I’ll do to make things working) but I think that, as get-size-text does, this should be redirected directly in offset-to-caret function which can deal with specific Windows case. menu-x and menu-y (or something related which are doing the trick to get event/offset on EVT_MENU) are only introduced in Windows and are missing on macOS. load/next/trap to https://github.com/red/red/wiki/%5BDOC%5D-Guru-Meditations ? Thanks.mold, load, and save is to document how things work today, considering write and form also. That way we can point to the exact issues and see if proposals can address them without introducing new ones.a 1 2 to 3. The console takes that value and displays it in the console. The program ignores the result of the evaluation. Red []
a: func t: [x y][print x + y]
b: func t [print x + y]
do [
a 1 2
b 3 4
""
] >> f: func [return: [integer!] "descr" ] [] *** Script Error: invalid function definition: return: *** Where: func *** Stack: f
retris.redRed [Needs: View]
makegradientimage: func [gradientcolors][
cmd: compose [
fill-pen linear ( gradientcolors) 0x0 0x800
box 0x0 1200x800
]
draw 1200x800 cmd
]
img1: makegradientimage [yellow red]
img2: makegradientimage [red yellow]
img3: makegradientimage [blue green]
images: [img1 img2 img3]
count: 0
forever [
forall images [
view/no-wait compose [ image (images/1)] wait 0.1 unview
count: count + 1 print count
]
]32 33 *** Runtime Error 1: access violation *** at: 000C9F01h >> about Red 0.6.4 for macOS built 5-Mar-2019/7:09:36+10:00 commit #53b5b37
recycle/off: app does not crash anymore (at least until available memory is exhausted).o: object [ i: 1 on-change*: func [w o n] [print [w "changed" o ">" n]] ] o/i: o/i + 1 set in o 'i o/i + 1 do bind [i: i + 1] o ? o/i
i changed 1 > 2 O/I is an integer! value: 4
set-path! usage.parse.reds fromif any [type = TYPE_LIT_WORD type = TYPE_LIT_PATH][if type = TYPE_LIT_PATH [--test-- "replace/case/deep-1" --assert [x A x B [x A x B]] = replace/case/deep/all [a A b B [a A b B]] ['a | 'b] 'x --test-- "replace/case/deep-2" --assert (quote (x A x B (x A x B))) = replace/case/deep/all quote (a A b B (a A b B)) ['a | 'b] 'x
read on a file in order to parse some numbers out of it. I am getting the following error:>> read %out
*** Access Error: invalid UTF-8 encoding: #{B7207477}
*** Where: read
*** Stack:
>>one · twoto-string also gives the same error. U+00B7 and shouldn't cause any trouble. That is, assuming that your file uses UTF-8 encoding.>> to binary! probe #"^(00B7)"
#"·"
== #{C2B7}
>> to binary! probe "one ^(B7) two"
"one · two"
== #{6F 6E 65 20 C2B7 20 74 77 6F} ; spaced out code units by hand>> view [rich-text 100x100 draw [text 10x10 "hello"]]
>> about Red 0.6.4 for Windows built 14-Mar-2019/18:49:29+01:00 commit #43b2683 >> about/debug -----------RED & PLATFORM VERSION----------- RED: [ branch: "master" tag: #v0.6.4 ahead: 193 date: 14-Mar-2019/17:49:29 commit: #43b26838b4a39cd20e06a9b6c2f5c2b873e058b7 ] PLATFORM: [ name: "Windows 10" OS: 'Windows arch: 'x86-64 version: 10.0.0 build: 17134 ] -------------------------------------------- >>
view compose/deep [rich-text 100x100 draw [text 10x10 (rtd-layout ["hello"])]]
It will throw an error now.>> (draw 100x100 compose [text 50x50 (rtd-layout [b "test" /b])]) *** Script Error: invalid Draw dialect input at: [make object! [type: 'rich-text offset: none size: 150x150 text: "test" image: none color: 255.255.255 menu: none data: [1x4 bold] enabled?: true visible?: true selected: none flags: none options: none parent: none pane: none state: none rate: none edge: none para: none font: none actors: none extra: none draw: none tabs: none line-spacing: 'default handles: [handle! handle! handle! "test" true]]] *** Where: draw-image *** Stack: draw
Draw extension text <pos> <text> <pos> : a pair! value indicating the upper left corner of the text-box. <text> : a string, or a rich-text face object with a rich-text description in single-box
red --cli bug11.red, and only with builds since (and including) March 4. The previous build I have is from January 30 - it does not appear there, most likely because it's RAM layout is a little bit different.*** Script Error: PARSE - matching by datatype not supported for any-string! input *** Where: parse *** Stack: view show show do-safe react
d and d2 lists makes the bug go away.d2 lengths 1..200 and my results so far are:*** Script Error: cannot access wheel-outside? in path fa/wheel-outside?.red/system syntax highlightingred/system needs to be created since source.redsscope seems to be the same then source.red scope. Thanks for your fix, it works perfectly… Red [needs 'view] view [ style styledf1: field 150x30 font [size: 14] style styledf2: field 200x30 font [size: 14] below f1: field 150x30 "f1" font [size: 14] f2: field 150x30 "f2" font [size: 14] f3: styledf1 "f3" f4: styledf1 "f4" f5: styledf2 "f5" f6: styledf2 "f6" ]
view [ style styledf1: field 150x30 font [size: 14] style styledf2: field 200x30 font [size: 14] below f1: field 150x30 "f1" font [size: 14] f2: field 150x30 "f2" font [size: 14] f3: styledf1 150 "f3" ; override width f4: styledf1 150x30 "f4" ; override size f5: styledf2 "f5" f6: styledf2 "f6" ]
q. Things like print q kills the GUI Console, and exits the CLI console.print evaluates, so it's expectedwhat qq should fire off if it is supplied to a functionwhat is a 0-arity function.q: "tralala, I'm safe now" and it's solvedwhat what errors, it what followswhat is a 0-arity function. It doesn't accept any arguments.if q ["bye"] <--- I don't likeif q [do stuff]. A bit unrealistic example, but chances for unpleasant surprise is there."Stops evaluation and exits the program" .help q to quit the program?help q doesn't quit the program.q is encountered.[q] should halt the console.unset 'q.if :q [...], whatever./help room.qthird write/info/binary http://google.com [GET [Accept-Charset: 'utf-8] ""]
write/info/binary http://google.com [GET [Accept-Charset: "utf-8"] ""] work (string instead of word)send-request: https://github.com/rebolek/red-tools/blob/f2e4cba2d2c2a19caa4b952054d1e88c1d6cdb01/http-tools.red#L224>> view [fld: field no-border all-over on-over [print "."]] ? fld/flags FLD/FLAGS is a word! value: no-border
[no-border all-over]q discussion above, q is predefined only when running code from the console. It's an handy shortcut that exists in Rebol console too.parse rule block seem to be failing. Example:parse "" [
; test comment
(print "one-line comment passed")
comment {}
(print "multi-line comment passed")
thru end
]print command succeeds, yet the second doesn't, and parse returns false, without ever getting to the end.comment is just a function that simply eats its argument, and has no place in Parse.>> :comment == func ["Consume but don't evaluate the next value" 'value][]
>> parse reduce ['a 'b :comment 'c][2 word! comment 'c] == true >> parse reduce [:add :add :divide][2 add divide] == true
comment is a word on its own here. comment exists.comment, although using parens around it. Not as intuitive as having multi-line built-in, but will get the job done anyway.;{ ignored
text
here }/timezone and /zone date accessors where the first one modifies time and the second not?>> d: now == 28-Mar-2019/21:32:16+01:00 >> d/timezone: 2 d == 28-Mar-2019/22:32:16+02:00 >> d/zone: 3 d == 28-Mar-2019/22:32:16+03:00
Red setting a zone to date without time adds zero time, is it ok or someone would prefer an error instead?>> d: 28-Mar-2019 == 28-Mar-2019 >> d/zone: 1 d == 28-Mar-2019/0:00:00+01:00
to-utc-date function.date! (lexically). to-date/utc instead.to-date/utc raises an old question, because all to-funcs are generated automatically. Do we want to customize each one or keep them as basic convenience funcs?to-*-* functions.to-file/red to-file/local? I say no, because the latter produces a string for platform interaction. I don't know of any others, but if you can list some, we can go from there.to-* functions as I know, that they are just a syntax sugar. And so it's a shame that these are not more clever in some situations.>> to-string/from #{9AE96D} 'cp1252
== "šém">> iconv #{9AE96D} 'cp1252
== "šém"help to-string and see some information without knowing, that there is also iconv native or codecs for such a conversion.to syntax put people off early on. I think we could live without them, but they're good for rebol compatibility and don't cost much to include, being automatically generated.Red [needs: View] view [ canvas: base 540x540 draw [] on-down [print event/offset] on-wheel [print event/offset] on-created [set-focus canvas] ]
on-wheel returns different coordinates than on-down?>> view [ [ canvas: base 540x540 draw [] [ on-down [print ["on-down" event/offset]] [ on-wheel [print ["on-wheel" event/offset]] [ on-created [set-focus canvas] [ ] on-down 242x70 on-wheel 259x74 on-wheel -10x550 on-wheel -2147483648x550 on-wheel -2147483648x550 on-wheel -2147483648x550 on-wheel -10x-2147483648 on-wheel -10x550 on-wheel -10x550 on-wheel -10x550 on-wheel -10x550 on-wheel -10x-2147483648 on-wheel -10x-2147483648 ...
>> view [ [ canvas: base 540x540 draw [] [ on-down [print ["on-down" event/offset]] [ on-wheel [print ["on-wheel" event/offset]] [ on-created [set-focus canvas] [ ] on-down 152x140 on-wheel 894x195 on-wheel 893x195 on-wheel 893x194 on-wheel 897x196 on-wheel 897x196 on-wheel 897x196 on-wheel 897x196 on-wheel 897x196 on-wheel 897x196 on-wheel 897x196 on-wheel 897x196 on-wheel 897x196
>> about Red 0.6.4 for Windows built 29-Mar-2019/13:23:41-07:00 commit #fee17b2 >> do https://raw.githubusercontent.com/red/red/master/environment/reactivity.red *** Script Error: invalid function definition: return: *** Where: do *** Stack: do-file
PS D:\red\red> ./red.exe --cli Compiling Red console... *** Compilation Error: exec/gui/get-text-size is missing an argument *** in file: %/C/ProgramData/Red/CLI/gui-console.red *** in function: exec/ctx373~size-text *** at line: 2548 *** near: [pair] PS D:\red\red>
console fileview [field on-key [probe event/window]] in console and confirm that field ceases to function as expected?win7 RED: [ branch: "master" tag: #v0.6.4 ahead: 197 date: 22-Mar-2019/21:33:44 commit: #a76753122probe event/window does nothing in my branch compared with macos where none is printed.probe returns window's object!, not none.word!, albeit the one that lexer recognizes as invalid float!.>> .0. *** Syntax Error: invalid float! at ".0." *** Where: do *** Stack: load
parent facet that's the problem it seems.view [field on-key [probe face/parent]] does it too, but not general object cycles it seems.area.>> system/view/auto-sync?: no == false >> view [field area]
view [t: text "" field on-key [append t/text event/key]]
view [field on-key [p: face/parent p/parent: none probe p]] ; OK view [field on-key [p: face/parent probe p]] ; Not OK
Probe face/parent interrupts field/area event handling.print mold does the same thing, so it's not returning the value, as probe does which causes the problem.text? Can anyone confirm that?view [t: text "" field on-key [append t/text event/key]]
on-key-up it kind of works, but uppercases.text? Seems OK here on Win10. Or I'm not caffeinated enough to see what I'm missing.view [t: text "" field on-key [append t/text event/key]] is working properly on linux/GTK after some fix but not related to the event-eating.;{...} lexical proposition :point_up: [March 26, 2019 10:22 PM](https://gitter.im/red/bugs?at=5c9a981bcf786a56c7824711) for multiline comments (I guess it's for comments?), at first look, it seems like that could work. The idea of combining the meaning of ; with multiline string notation makes sense. What are others thinking about it?/time and /timezone are welcome.;{...} as a new comment, I'm not sure if I like it... I would rather used /*...*/ as it is already common syntax in other languages and I believe that lexer should not have problems with it./*...*/ is common, that is true, however it correlates with the use of // for single-line comment in the same subset of languages, which in turn also leverages the notion of likeness. The idea of ; and ;{...} follows the same logic.;{...} is, that } is quite common char and the lexer would have more work to find, where it ends... on the other side, you probably will not find any /* or */ combinations in current scripts and so finding the end of comment would be cheaper.;{...} would handle this?;{
{}{ in it? In the latter case you'll need to escape {, which is at odds with the very definition of multiline comment.;{..} is that it has to parse the {..} part using string rules, not just skip until it finds a }. More lexer load than a bunch of ;-s. But I also dislike /**/ syntax for /* can be a refinement.comment is that it's not truly invisible, and also returns unset. Something like#macro comment: func [v][[]]
COMMENT should be managed inside of LOAD... its very easy to add.#comment will be better at hinting that it's a preprocessor stuff.;{ looks like a sad drunken cat./* and */ are valid any-word! values, so it would be painful to support, as that would introduce exceptions in words lexical space...;{...} would handle this?load, it would be better if we can find a specific syntax that is part of the lexical rules.comment is a function, so it's processed at run-time. We want a way to identify multiline comments at the lexer time, so they can be safely removed without causing any kind of side-effect.\ is a word that plunges into token stream and ignores everything up to the end of line. If you don't like \ you just redefine it :wink: comment should not be a function it should be a statement within load.comment is fine, just it is not handled in dialects... like:>> view [base 400x400 comment {why?}]
*** Script Error: VID - invalid syntax at: [comment "why?"]
*** Where: do
*** Stack: view layout cause-error;-- ... -- then? Probably easier to parse, and already partially used as a style convention in Red.;-- --
-- (a valid word, FYI), or a multi-line comment?; in syntax highlighting. ; for multi-lines :-) unicode has thousands of characters. we can use this to our advantage*/ sequence./* as an valid refinement. */ is also not valid path./*$ echo "/**" > test.c && gcc test.c test.c:1:1: error: unterminated comment /** ^
;{...}; could work.text
;{
{};; and if it finds { - it treats it as multiline. Like a single token ;{; to start a multiline comment would break some of my code. we have been using ; as a single line comment for so long that we all have built some of our own standards for characters following it. ; for multi-lines :-) unicode has thousands of characters. we can use this to our advantagegui-console-ctx/terminal/color?: yes'/ and everything disappears and starts spamming*** Script Error: cannot MAKE/TO word! from: 0 *** Where: to *** Stack: ask do-events do-actor do-safe to-word
'%red-master\environment\ so I have no cluewin7. run old-gui, crash. not sure what else can be saidred-master\environment\console\GUI\old\gui-console.red modal flag works on macOS?Red [] x: [1] if single? x [print "TRUE"]
-c and -r (unless I also provide -e), and see this error:Compiling D:\devel\red\red-av\1.red ... *** Compilation Error: expected a block for IF-BODY instead of word! value *** in file: D:\devel\red\red-av\1.red *** near: [x [print "TRUE"]]
unless instead of if. I can however compile it with empty? or some other function in place of single?.>> do reduce [func [:a :b :c][1] '+ '- '*] *** Script Error: object!: needs a value *** Where: object! *** Stack: >> do reduce [func [:a :b][1] '+ '-] *** Script Error: + does not allow none! for its value2 argument *** Where: + *** Stack: >> do reduce [func [:a][1] '+] *** Script Error: + operator is missing an argument *** Where: do *** Stack:
>> f: func [:a :b] [1] == func [:a :b][1] >> do reduce [:f '+ '-] root size: 3487, root max: 4899, cycles: 0 *** Runtime Error 1: access violation *** in file: /D/devel/red/red-src/red/runtime/datatypes/string.reds *** at line: 1045 *** *** stack: red/string/concatenate-literal-part 02B403F4h 00779000h 6320358 *** stack: red/datatype/mold 02E8A248h 02B403F4h false false true 00000000h 0 0 *** stack: red/actions/mold 02E8A248h 02B403F4h false false true 00000000h 0 0 *** stack: red/error/reduce 02B403D4h 02C608CCh *** stack: red/error/form 02C608CCh 02B403C4h 02B403A4h -18 *** stack: red/actions/form 02C608CCh 02B403C4h 02B403A4h 0 *** stack: red/block/form 02B403B4h 02B403C4h 02B403A4h 0 *** stack: red/actions/form 02B403B4h 02B403C4h 02B403A4h 0 *** stack: red/actions/form* -1 *** stack: red/natives/prin* true *** stack: red/natives/print* true *** stack: ctx475~do-command 003F1BC0h *** stack: ctx475~eval-command 003F1BC0h *** stack: ctx475~run 003F1BC0h *** stack: ctx475~launch 003F1BC0h
> Red [] > x: [1] > if single? x [print "TRUE"] >
-c and -r (unless I also provide -e), and see this error:> Compiling D:\devel\red\red-av\1.red ... > *** Compilation Error: expected a block for IF-BODY instead of word! value > *** in file: D:\devel\red\red-av\1.red > *** near: [x [print "TRUE"]] >
unless instead of if. I can however compile it with empty? or some other function in place of single?.single? function is defined is not compatible with the compiler:single?: last?: func [
name: func and name: :other-name patterns for defining functions. last?: single?: func [ but it didn't help. Still complains about single? but not last? when I invoke red.r on that file.set-word! set-word! ['func | ... ], right?grep on all source files will do. My own (fairly primitive) grep found just the one single?: last?: instance.? * and - .runtime\datatypes\char.reds and runtime\datatypes\integer.reds, probably they handle parameter types differently.char! doc under arithmetic?char! doc. As Result cast to the type of the first arg is not exactly correct for integer! + other-types char! datatype, how it implements + action. And other op!s as well:>> #"b" / 2 == #"1" >> #"b" % 2 == #"^@"
>> system/console/prompt: "...^/>>" == "...^/>>" ... >> ... >> ... >>
1 + 1:2:3 will return time!, 1 + 2x3 returns pair!.f: func [a a] [] ;*** Script Error: duplicate variable specified: a, so restricting doesn't have any value, even it is useless.x are bound to different contexts.b: []
append b in o: context [x: 1] 'x
append b in p: context [x: 2] 'x
;b == [x x]
foreach :b [3 4] []
>> o
== make object! [
x: 3
]
>> p
== make object! [
x: 4
]foreach doesn't bind the word to the block it iterates. It doesn't change the object's values in Rebol for the above example.>> foreach [x x] [1 2 3 4] [print x] 1 3
/ is illegal character in ASCII subset for word!>> rejoin [http://one/two /three] == http://one/twothree >> rejoin [http://one/two '/ 'three] == http://one/two/three
refinement!,>> append "" /three == "three" >> to "" /three == "three" >> print /three three >> append a@b.com /three == a@b.comthree ;but! >> append [] /three == [/three]
1dc4661e (HEAD -> master, origin/master, origin/HEAD) FIX: extra fix for issue #3864. a379f8fb Merge pull request #3878 from hiiamboris/call-shell-fix f24e4a07 FIX: patch for commit #8e99d131 (PR #3877) 3711bf1a Merge pull request #3877 from hiiamboris/call-shell-fix 8e99d131 FIX: issue #3869 (Internal usage of `call/shell` does not conform to `cmd.exe` specs on Windows) c63d111c FIX: issue #3873 (Trim does not work as expected for binary! argument) 47fc6a9b FEAT: adds memory usage before/after a GC cycle in debug output. a7b79d8f TESTS: adds base 2 binary syntax tests (#3855) 98148ee9 FIX: issue #3855 (Syntax Error: invalid binary!)
-----------RED & PLATFORM VERSION----------- RED: [ branch: "master" tag: #v0.6.4 ahead: 259 date: 15-May-2019/22:02:20 commit: #1dc4661ef7a7040455351d96e428f418e256e518 ] PLATFORM: [ name: "Windows 10" OS: 'Windows arch: 'x86-64 version: 10.0.0 build: 17134 ] --------------------------------------------
@echo off d: cd D:\Projects\Red\red\build\bin\ red.exe --cli --catch user.red
d:\Projects\Red\red\build\bin>rc *** Driver Internal Error: Script Error : offset? expected series2 argument of type: series *** Where: form-args *** Near: [all [ pos2: find system/options/args flag: "--catch" positive? offset? pos2 pos insert insert args flag #" " ] args ]
user.red file.--catch before it's fixed--catch is some historical remnant that should only hide the banner when run with --cli, but that doesn't work since 061 or beforecatch?: no ;-- YES: force script to fallback into the console so it was probably originally meant for something elsered.exe --cli --catch user.red is to execute user.red and then fall into Red/CLI console, so I have all my predefined functions. So I cannot remove --catch.--catch option appears is in [console/read-argument](https://github.com/red/red/blob/1dc4661ef7a7040455351d96e428f418e256e518/environment/console/engine.red#L46) and there it sets the system/console/catch? flag to truecatch? flag is only used in [console/launch](https://github.com/red/red/blob/master/environment/console/engine.red#L271) and only affects if /no-banner refinement will be provided to console/runconsole/run this refinement [only affects the header output](https://github.com/red/red/blob/1dc4661ef7a7040455351d96e428f418e256e518/environment/console/engine.red#L224) but nothing else--catch console does not quit after the script execution???--catch flag is specifically created for that - fall thru to console instead of closing it after script finished running.run-console is called and how --catch affects it.--catch flag to the console command line (inserts it before the script name)run -> no console -> exit.run otherwise. I see now.remove-each return the modified series! ?>> probe remove-each item [a 1 2 b 3] [integer? item] unset >> about Red 0.6.4 for Windows built 25-Dec-2018/13:56:39+02:00 commit #67a6bff
>> remove-each item bl: [a 1 2 b 3] [integer? item] >> bl == [a b]
foreach. Altough I agree, that it would be nice to return modified block.remove-each ... remove-each ...unset. :) And as I said, it would be nice to have modified block returned.remove-each/into could be interesting, but it is unclear that it will append the items removed or the rest.take-each for that.>> checksum "12345678901234567890123456789012345678901234567890123456789012345678901234567890" 'adler32 *** Runtime Error 1: access violation *** in file: /X/GIT/Siskin-framework/Public/Red/red/runtime/crypto.reds *** at line: 345 *** *** stack: red/crypto/adler32 0298C248h 80 *** stack: red/natives/checksum* false -1 *** stack: red/interpreter/eval-arguments 0278FA34h 0298C118h 0298C118h 00000000h 00000000h *** stack: red/interpreter/eval-code 0278FA34h 0298C0F8h 0298C118h false 00000000h 00000000h 0278FA34h *** stack: red/interpreter/eval-expression 0298C0F8h 0298C118h false false false *** stack: red/interpreter/eval 0268E964h true *** stack: red/natives/catch* true 1 *** stack: ctx373~try-do 00C9B694h *** stack: ctx373~do-command 00C9B694h *** stack: ctx373~eval-command 00C9B694h *** stack: ctx373~run 00C9B694h *** stack: ctx373~launch 00C9B694h
needs: view to the CLI console environment\console\CLI\console.red header, save it as console-view.red and build it with rebol -s --do "do/args %red.r {-r -d environment/console/CLI/console-view.red} quit" commandrecycle/off. If you can't reproduce the crash, it's the GC's fault. Turn GC on and proceed with 2. whatever the outcome of 1.-r -d options and run it from DOS shell, instead of clicking on it. When it crashes, you'll get a call stack dump that you can report here.red.exe -c -e -r -t windowsview [ text 30x600 react [ face/text: tarea/text ] tarea: area 300x400 ""]>> view [area] *** Script Error: cannot access area in path system/view/metrics/colors/(face/type) >> about/debug -----------RED & PLATFORM VERSION----------- RED: [ branch: "master" tag: #v0.6.3 ahead: 1411 date: 23-May-2019/21:22:44 commit: #f7d3a96c8e403e24c97113223eb416171e94e238 ] PLATFORM: [ name: "Windows 10" OS: 'Windows arch: 'x86-64 version: 10.0.0 build: 17134 ]
field, button, check and radio faces. Probably a regression of latest commits about maps.find, as with blocks.>> x: 10 == 10 >> - x == -10
>> - x ** Script error: - operator is missing an argument
>> - x *** Script Error: - operator is missing an argument *** Where: catch *** Stack:
negate x)op!.- 10 is invalid expression.>> a: make map! [b 1]
== #(
b: 1
)
>> find a first [b:]
== b
>> a
== #(
b 1
)
>> find a first [b:]
== nonetrue:>> a: make map! [b 1] == #(b: 1) >> find a 'b ; or >> find a first [b:] ; returns ==true
remove/key too? that date seems wrongRed [] index? none
D:\Projects\Red\red\build\bin>test.exe *** Runtime Error 1: access violation ;Red 0.6.4 for Windows built 27-May-2019/19:00:46+03:00 commit #3dbcad2
>> a: #("one" 2 "three" four)
== #(
"one" 2
"three" four
)
>> select a "one"
== 2
>> remove/key a "one"
== #(
"three" four
)
>> select a "one"a/("one") doesn't cause the problem, only select does.txt: "" loop 1000 [insert txt rejoin ["Scroll me with mouse wheel up and down continuously" lf]] view [area txt 600x300]
*** Runtime Error 13: integer divide by zero *** in file: /C/Users/*****************/Desktop/bug/m odules/view/backends/windows/events.reds *** at line: 1499 *** *** stack: gui/process 0000000Dh *** stack: win32-startup-ctx/exception-filter 0017FA24h
default [EVT_DISPATCH]divide by zero is in here: https://github.com/red/red/blob/073d19179c7b20d96a405e915bf8a2572e83b870/modules/view/backends/windows/events.reds#L1445x / y for zero case anyway. And then we'll see if @GiuseppeChillemi can still crash it.assert y <> 0 before [this line](https://github.com/red/red/blob/073d19179c7b20d96a405e915bf8a2572e83b870/modules/view/backends/windows/events.reds#L1445) and see if the zero divide error changes into an assertion error?extract-boot-args.none in the beginning of the extract-boot-args function unless args: system/script/args [exit], but system/script/args is empty string instead of none if there is no args to the script. Should it be fixed?do/args %red.r "-r -t Windows %environment/console/GUI/gui-console.red"
Script: "Red command-line front-end" (none) ** Access Error: Cannot open /*/_Drives/**********/********/Svi/red-master/system/utils/encap-fs.r ** Near: do %system/utils/encap-fs.r >>
-t WindowsXP. That removes the dependency on the gesture API.do/args %red.r "-r -t WindowsXP %environment/console/GUI/gui-console.red"gui-console executable?CMD:> gui-console.exe -r -d -t MSDOS buggy.r
*** Access Error: cannot open: %-r *** Where: read *** Stack: --== Red 0.6.4 ==-- Type HELP for starting information. >>
gui-console buggy.red (it's .red is it not?)do/args %red.r "-r -d -t WindowsXP %environment/console/GUI/gui-console.red"-d flag, all console output is mirrored into the dos prompt window, so even when the console closes I still see itassert*** Runtime Error 98: assertion failed *** in file: /C/Users/Administrator/Dropbox/Svi/red-master/modules/view/backends /windows/events.reds *** at line: 1500 *** *** stack: gui/process 00000062h *** stack: gui/process 0018F9F4h *** stack: gui/do-events false *** stack: ctx408~do-event-loop false *** stack: do-events *** stack: view *** stack: red/_function/call 02500CA4h 00883884h *** stack: red/interpreter/eval-code 02500CA4h 02885B6Ch 02885B6Ch false 00000 000h 00000000h 02600FE4h *** stack: red/interpreter/eval-expression 02885B5Ch 02885B6Ch false false fal se *** stack: red/interpreter/eval 02500C94h true *** stack: red/natives/try* true 0 *** stack: do-file *** stack: red/natives/do* false -1 -1 -1 *** stack: red/interpreter/eval-arguments 02600414h 02885560h 02885560h 000000 00h 00000000h *** stack: red/interpreter/eval-code 02600414h 02885550h 02885560h false 00000 000h 00000000h 02600414h *** stack: red/interpreter/eval-expression 02885550h 02885560h false false fal se *** stack: red/interpreter/eval 02500BE4h true *** stack: red/natives/catch* true 1 *** stack: ctx510~try-do 008A1450h *** stack: ctx510~do-command 008A1450h *** stack: ctx510~eval-command 008A1450h *** stack: ctx510~run 008A1450h *** stack: ctx510~launch 008A1450h
x / y line. I suppose some drivers *do* report a zero wheel offset after all.red/interpreter/eval-arguments 02600414h 02885560h 02885560h 000000 00h 00000000h
eval-arguments function (memory addresses)*** Runtime Error 98: assertion failed >> append http://foo? "%20b" == http://foo?%20b
>> append http://foo? "%20b" == http://foo?%2520b
>> append http://foo? " b" == http://foo?%20b
>> append http://foo? " \b" == http://foo?%20\b ;<---- should be http://foo?%20%5Cb
dehex before appending. But \ is not a special char in URLs, so that's not a bug. Here are the general delims and sub-delims, which shows some are escaped, but not all:>> append http://foo? ":/?#[]@" == http://foo?:/?#%5B%5D@ >> append http://foo? "!$&'()*+,;=" == http://foo?!$&'%28%29*+,%3B=
\ should be escaped. I agree that it is difficult topic.\ for?>> mold append http:// {%28}
== "http://%2528"
>> form append http:// {%28}
== "http://%28"
>> dehex form append http:// {%28}
== "http://("
>> dehex mold append http:// {%28}
== "http://%28"url! wiki page.make-face/spec 'base [red] hangs the CLI & GUI console. Tested on Win10.delete the ability to delete an image.attempt with exit and without safer refinement breaks attempt function:>> attempt [1 / 0] == none >> attempt [a: 10 exit] *** Script Error: invalid argument: [a: 10 exit] >> attempt [1 / 0] == [1 / 0]
exit and return are throwing specific exceptions, so they are not caught by a simple attempt (using try internally), it needs the /safer option. Though, the error there is odd...lisp >> attempt [a: 10 exit] *** Script Error: invalid argument: [a: 10 exit] *** Where: catch *** Stack: >> probe :attempt console == console
\ disappear and path elements are joined.E:DrivesDropBox Giuseppe Chillemiropboxvirj-LearnRED\\{
"red.redPath": "E\\_Drives\\_DropBox Giuseppe Chillemi\\Dropbox\\Svi\\prj-LearnRED",
"red.buildDir": "E:\\_Drives\\_DropBox Giuseppe Chillemi\\Dropbox\\Svi\\prj-LearnRED"
}*.red will be treated as Red file, if you want *.r as Red file, please select language mode to RedredPath also should include the red.exe, and it looks like you are missing the colon on the drive letter{
"red.redPath": "E:\\_Drives\\_DropBox Giuseppe Chillemi\\Dropbox\\Svi\\prj-LearnRED\\Red.exe",
"red.buildDir": "E:\\_Drives\\_DropBox Giuseppe Chillemi\\Dropbox\\Svi\\prj-LearnRED\\"
}Windows PowerShell
Copyright (C) Microsoft Corporation. Tutti i diritti sono riservati.
PS C:\Users\myname> E:\_Drives\_DropBox Giuseppe Chillemi\Dropbox\Svi\prj-LearnRED\Red.exe --cli e:\_Drives\_DropBox Giuseppe Chillemi\Dropbox\Svi\prj-LearnRED\VSCodeTry.red
E:\_Drives\_DropBox : Termine 'E:\_Drives\_DropBox' non riconosciuto come nome di
cmdlet, funzione, programma eseguibile o file script. Controllare l'ortografia del
nome o verificare che il percorso sia incluso e corretto, quindi riprovare.
In riga:1 car:1
+ E:\_Drives\_DropBox Giuseppe Chillemi\Dropbox\Svi\prj-LearnRED\Red.ex ...
+ ~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (E:\_Drives\_DropBox:String) [], Comma
ndNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundExceptionObjectNotFound: (E:\_Drives\_DropBox:String)E:\\_Drives\\_DropBox\ Giuseppe\ Chillemi\\Dropbox\\Svi\\prj-LearnRED\\Red.exe or how does the escaping work there.\and see what happensE:\_Drives\_DropBoxspace>Giuseppespace>Chillemi\Dropbox\Svi\prj-LearnRED\, it's just that Gitter strips space from codeE:/_Drives/_DropBox Giuseppe Chillemi/Dropbox/Svi/prj-LearnRED should be ok\ was another solution !{
"red.redPath": "E:\\_Drives\\_DropBox%20Giuseppe%20Chillemi\\Dropbox\\Svi\\prj-LearnRED\\Red.exe",
"red.buildDir": "E:\\_Drives\\_DropBox%20Giuseppe%20Chillemi\\Dropbox\\Svi\\prj-LearnRED\\"
}PS C:\Users\myname> E:\_Drives\_DropBox%20Giuseppe%20Chillemi\Dropbox\Svi\prj-LearnRED\Red.exe --cli e:\_Drives\_DropBox Giuseppe Chillemi\Dropbox\Svi\prj-LearnRED\VSCodeTry.red
E:\_Drives\_DropBox%20Giuseppe%20Chillemi\Dropbox\Svi\prj-LearnRED\Red.exe : Termine
'E:\_Drives\_DropBox%20Giuseppe%20Chillemi\Dropbox\Svi\prj-LearnRED\Red.exe' non
riconosciuto come nome di cmdlet, funzione, programma eseguibile o file script.
Controllare l'ortografia del nome o verificare che il percorso sia incluso e
corretto, quindi riprovare.
In riga:1 car:1
+ E:\_Drives\_DropBox%20Giuseppe%20Chillemi\Dropbox\Svi\prj-LearnRED\Re ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (E:\_Drives\_Dro...earnRED\Red.exe:Str
ing) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundExceptiontext 'E:\\_Drives\\_DropBox Giuseppe Chillemi\\Dropbox\\Svi\\prj-LearnRED\\Red.exe'
E:\\_Drives\\_DropBox` Giuseppe` Chillemi\\Dropbox\\Svi\\prj-LearnRED\\Red.exe
/bugs room to solve it is beyond my understanding.[~] mkdir dir\ with\ spaces [~] cp /usr/local/bin/red dir\ with\ spaces [~] dir with spaces/red dir: cannot access 'with': No such file or directory dir: cannot access 'spaces/red': No such file or directory
>> uppercase "ı" == "I" >> uppercase "i" == "I" >> uppercase "o" == "O" >> uppercase "ö" == "Ö"
on-wheel actor's event info has changed. event/picked returns float now instead of integer, which may be intended change. But also, event/ctrl? returns true on wheeling down without ctrl pressed, and false while wheeling up. When ctrl is pressed, returned value for event/picked is 2236963.133333333 while wheeling up:view [base on-wheel [print [event/ctrl? event/picked]]] true -1.0 ;down false 1.0 ;up
true -1.0 ;down true 2236963.133333333 ;up
on-over actor returns false for event/ctrl? on away event, while ctrl is actually pressed:>> view [base on-over [print [event/ctrl? event/away?]]] false false ;w/o ctrl, into false true ;w/o ctrl, away true false ;ctrl, into false true ;ctrl, away
view [base on-wheel [print [event/ctrl? event/shift? event/picked]]] true true -1.0 ;w/o ctrl/shift, down false false 1.0 ;w/o ctrl/shift, up true true -1.0 ;ctrl, down true false 2236963.133333333 ;ctrl, up true true -1.0 ;shift, down false true 4473925.266666667 ;shift, up true true -1.0 ;ctrl/shift, down true true 6710887.4 ;ctrl/shift, up
>> view [base on-wheel [print [event/ctrl? event/shift? event/picked]]] false false -1 ;w/o ctrl/shift, down false false 1 ;w/o ctrl/shift, up true false -1 ;ctrl, down true false 1 ;ctrl, up false true -1 ;shift, down false true 1 ;shift, up true true -1 ;ctrl/shift, down true true 1 ;ctrl/shift, up >> about Red 0.6.4 for Windows built 21-May-2019/3:23:06+03:00 commit #c80ba51
on-over acted the same way as now.red --helpCross-compilation targets:
MSDOS : Windows, x86, console (+ GUI) applications
Windows : Windows, x86, GUI applications
...
Darwin : macOS Intel, console or GUI applications
macOS : macOS Intel, GUI-only, applications bundlesprint works with -t macOSexcept in this particular case where red code is triggered with #call. This inconsitency made me think the #call was not working. Moreover, this is working with -t Windows. This makes it even more inconsistent as I don't have to use -t MSDOS have the print working on Windows with #call. Remember, print is amongst the few tools available to debug Red programs. I would have expected a "write once, run everywhere" behaviour when targeting equivalent platforms (ie Windows and macOS).-t Windows, then there is a bug on Windows. No terminal will be showed if you use -t Windows, so you cannot see the output of print. Unless you include a gui-console in your app.printcommands are shown. That's just my opinion.print behaviour is not the real problem I had with my GUI application. I got misleaded because nothing was happening with my #call: print showed nothing (explained above) and UI "area" was not updated. With the -t Darwin I could pinpoint the problem in my program. I don't know if it is a bug or an intended behaviour: my application receives data from an external library through a callback. The data is then sent from R/S to Red and put in an area view field. In this particular case only, the area content is not updated until I hover it with the mouse. Note that there are no actions done with the UI to update the area data, everything is triggered internally with a callback.area field in R/S? If so, you need to refresh the area manually.show area-face.view [button "Open Modal" 200 [view/flags [button 200 "Close Modal" [unview]] [modal] ] ]Red 0.6.4 for Windows built 16-Jul-2019/18:28:15+03:00 commit #66ba8c8view [button "Open Modal" 200 [view/flags [button 200 "Close Modal" [unview]] [modal] set-focus face] ]
Red [] #macro [path!] function [s e] [print ["ATE" s/1] []] invalid/path
*** Script Error: invalid has no valueATE invalid/pathCompiling D:\Red\temp\bad-macro.red ... ...using libRedRT built on 27-Jul-2019/13:40:20 ATE invalid/path ...compilation time : 17 ms Target: MSDOS
>> a: [adjective: false] == [adjective: false] >> a/adjective == false >> if a/adjective [print 1] 1
false is a word! not a logic! (true/false) value. a: compose [adjective: (false)] ; == [adjective: false] if a/adjective [print 1] ; == none
>> b: [x: #[false]] == [x: false] >> type? b/x == logic!
Compiling libRedRT... ...compilation time : 8110 ms Compiling to native code... ...compilation time : 209145 ms ...linking time : 5183 ms ...output file size : 1089536 bytes ...output file : Path\to\Desktop\mmacro\libRedRT.dll ATE invalid/path ...compilation time : 306 ms Target: MSDOS Compiling to native code... ...compilation time : 8731 ms ...linking time : 329 ms ...output file size : 75264 bytes ...output file : Path\to\Desktop\mmacro\macro.exe
Red 0.6.4 for Windows built 27-Jul-2019/0:58:18+02:00 commit #6890912-c?red --cli script.red*** Script Error: invalid has no value *** Where: catch *** Stack:
Red [needs: view]
r-src: make reactor! [num: 0]
process: func [][
repeat i 100 [
wait 0.1
r-src/num: to-percent ((to-float i) / 100)
; loop 3 [do-events/no-wait]
print r-src/num
]
]
view [size 200x200
below
progress 100x20 20% react [face/data: s/data]
s: slider 100x20 20%
progress 100x20 20% react [face/data: r-src/num]
button "start process" [process]
]loop 3 is not necessaryevent/ctrl? and event/shift? are not set on down event (neither on alt-down and mid-down). Neither are ctrl and shift set in event/flags. They were still set in May 21 build (I don't have more recent builds to check). Regression? (W10)o/oo/fn does nothing it seems, and (I think this is the known issue) o/fn crashes.-e) or using do [obj1/inputs/1/open].shift? and control? set for all arrow directions, but no events when I'm pressing alt (maybe a Windows thing?)ctrl and shift on pressing left button:>> view [base on-down [print [event/ctrl? event/shift?]]] false false ;ctrl down false false ;shift down false false ;both down >> about Red 0.6.4 for Windows built 30-Jul-2019/9:19:01+03:00 commit #3f14bf4
view [base on-key [print [event/key event/ctrl? event/shift? event/flags]]] down false false down true false control down false true shift down false false alt down true true control shift down false true shift alt
on-key events work.Red []
#macro dynh: func [height][
rejoin ["panel react [face/size: as-pair face/parent/size/x " height " ]"]
]
print [ dynh 300 ]>> Red []
== []
>> #macro dynh: func [height][
[ rejoin ["panel react [face/size: as-pair face/parent/size/x " height " ]"]
[ ]
== func [height][rejoin [{panel react [face/size: as-pair face/parent/size/x } height " ]"]]
>> print [ dynh 300 ]
panel react [face/size: as-pair face/parent/size/x 300 ]
>>Run Current Script in Visual Studio (OSX) I get*** Script Error: dynh has no value *** Where: print *** Stack:
>> do %test.red panel react [face/size: as-pair face/parent/size/x 300 ] >> about Red 0.6.4 for macOS built 24-Jul-2019/5:51:39+10:00 commit #613d71c
>> do %test.red *** Script Error: dynh has no value *** Where: do *** Stack: do-file >> about Red 0.6.4 for macOS built 24-Jul-2019/5:51:39+10:00 commit #613d71c
d:\red.exe -e test.red >> *** Access Error: cannot open: %-e
-s, -v, -d but -c, -r works.Red []
view [
panel on-down [
layout/parent compose [
text "A: " text "B"
] crash-box none
]
crash-box: group-box []
]
; *** Runtime Error 1: access violation
; *** at: A6C1CF13hlength? remove-each str "ABC" [str = #"B"]
R2: == 2
Red: == Script Error: length? does not allow unset! for its series argument
; Compare that with FOR for consistency:
length? remove "ABC"
R2&Red: == 2unset because a final design decision on their return values hasn't been made yet.split remove-each str "A B C" [str = #"B"] " "
set [series count] remove-each ... if you need the results.remove-each-and-count: function [
"Like remove-each, but returns both modified series and count of removed items."
'word [word! block!] "Word or block of words to set each time"
data [series!] "The series to traverse (modified)"
body [block!] "Block to evaluate (return TRUE to remove)"
][
orig-ct: length? data
remove-each :word data body
reduce [data orig-ct - length? data]
]
remove-each-and-count v [1 2 3 4 5] [odd? v]
remove-each-and-count v [1 2 3 4 5 6 7 8 9 10] [odd? v]break is evaluated on foreach-face loop as :l: layout [a: area 100x100 red b: box 100x100 green c: field 100x100 blue]
foreach-face l [if face/size/x = 100 [break]]throw) but Doc said we need a proper function attributes.copy/part built-in docs state that pair! argument is possible. but I get error when using pair!:>> copy/part "abcdef" 2x4 *** Script Error: invalid /part argument: 2x4 *** Where: copy *** Stack:
image! values only.image!](https://doc.red-lang.org/en/datatypes/image.html) documentation with missing details, although I'm not sure if it's is the best place to keep such info.image! is a series and can be manipulated by series functions by using pair!s is worth documenting. It's not so obvious and can generate questions like *is 2x1 before 1x2 in image series?*. I thought pair! can be used to denote start and end indexes of copy/part done on string! or block!, perhaps I'm not the only one.decompress/zlib:>> decompress/zlib #{78DA636060F8CFC4C0CA08C40C8C0CFC0C409A8551351044B302311323C35A109B1988D918557C1918D597310000597203BB} 52 ; Correct size
== #{
000000FF020005010200050001000F0002000504012551000200050502000502
0100AD00020005030200050601244D000127A600
}
>> decompress/zlib #{78DA636060F8CFC4C0CA08C40C8C0CFC0C409A8551351044B302311323C35A109B1988D918557C1918D597310000597203BB} 128 ; Bigger size
== #{
000000FF020005010200050001000F0002000504012551000200050502000502
0100AD00020005030200050601244D000127A600
}
>> decompress/zlib #{78DA636060F8CFC4C0CA08C40C8C0CFC0C409A8551351044B302311323C35A109B1988D918557C1918D597310000597203BB} 4 ; Too small size
== #{
000000FF020005010200050001000F00010000200000000010000000ACDFD801
BCDFD801237B0A30303030303046463032303030
} ; Notice initial data is correct, but the rest is garbagered-09aug19-8a9920e6 on MacOS Xdecompress native](https://github.com/red/red/blob/master/runtime/natives.reds#L2621) and [zlib-uncompress implementation](https://github.com/red/red/blob/master/runtime/inflate.reds#L762), for the reference.master (ccfff52)binary! data. I haven't found any ways to approximate or infer uncompressed data size from input itself (only compression level in zlib magic header).dst size, or this feature should not be available for general use. 5 0 obj << /Type /ObjStm /N 7 /First 40 /Length 489 /Filter /FlateDecode >> stream ... 489 bytes of compressed data ... endstream endobj
/Length is the compressed lengthFlateDecode filter which is zlib/deflate but no gzip alternative"^[[6n" on every session—is this a bug? I have a Red script:Red [] prin <hello>
>> call/wait/output "red script.red" out: "" >> probe out == "^[[6n<hello>"
^[[6n means in VT100 terminal Get cursor position. I don't know, why it is there. @rgchris, is it in CLI or GUI console or both? If only in GUI, I would say it is a bug.probe read http://www.repubblica.itRed [] red-fun: function [][ #system [ f: function [][ print-line "doing something" ] cpt: 0 f ] ]
*** Compilation Error: variable cpt not declared *** in file: %/C/ProgramData/Red/test-guard.red *** in function: exec/f_red-fun
#system should be declared at top level. Use routine!s instead.#system directive deep in code, but you need to understand what you are doing exactly. In this case, you are inlining a R/S function into another R/S function (Red compiles Red functions down to R/S functions). Your code is then equivalent to:Red/System [] red-fun: function [][ f: function [][ print-line "doing something" ] cpt: 0 f ]
cpt not being declared is legit. Moreover, the R/S compiler will let you declare and run the nested function, though it is not an officially supported feature, so we might deprecate it for 1.0.f function and cptvariable declarations out of the red-fun, into a root #system directive, then your inner #system code will compile and work fine.Red []
red-fun: function [][
#system [
f1: function [/local cpt][
f: function [][
print-line "doing something"
]
cpt: 0
f
]
f1
]
]
red-funIn this case, you are inlining a R/S function into another R/S function (Red compiles Red functions down to R/S functions). #system directive simply inlines its argument block at the current position of the output of Red compiler (which is R/S code). The block you are passing contains a R/S function declaration, so that declaration will be inlined there (see my equivalent R/S code above).Red []
#system [
f: function [][
print-line "doing something"
]
cpt: 0
]
red-fun: function [][
#system [f]
]midi-in-callback function triggered by an external dll (the process starts when triggering hardware externally and sends around 500 messages sequentially)midi-in-callback transforms received data to string! and binary! then calls a red function new-messagewith #call [new-message red-port-name red-message]new-message function after several calls of this to string conversion code:string-message: copy "" foreach byte message [append string-message form to-hex/size byte 2]
append model/binary-midi-messages messagenew-message. This let's me think that I am reaching some kind of limit when processing serveral messages with this code. What is interesting though is I can process all the values if I store all the values and then apply the string conversion (ie after all calls, not at each call)recycle/off at the very beginning)?-r -d flags). And, of course, make sure you check all of that with latest build.recycle/off, same error.-r -d I get this more detailed error:root size: 3120, root max: 4638, cycles: 0 *** Runtime Error 21: guard page *** in file: /C/ProgramData/Red/collector.reds *** at line: 61 *** *** stack: red/collector/mark-stack-nodes *** stack: win32-startup-ctx/exception-filter 050FF5A8h
to-image or to image! doesn't convert the layout to the image:lay: layout [button "Hi there!"] to image! lay
view/no-wait lay
img: to image! lay
unview lay
img ;== make image! [198x110 #{...layout you create just the _virtual structure_, which is converted to native widgets when you _view_ it. (if my english is understandable) lay/offset: negate lay/size when you want to view it just to make an image from it.*** Compilation Error: argument type mismatch on calling: red/eval-path*
*** expected: [struct! [
header [integer!]
data1 [integer!]
data2 [integer!]
data3 [integer!]
]], found: [struct! [
header [integer!]
ctx [pointer! [integer!]]
symbol [integer!]
index [integer!]
]]as red-value! somewhere in runtime internals.probe skip pc -40 before [this line](https://github.com/red/red/blob/master/system/compiler.r#L1468). Try backtracking further in the code is -40 is not satisfying.lit-word! arguments. It is inspired by my naive use of @greggirwin 's debug-obj function that he just published in red/red.>> f: function ['obj [word!]][
[ o: get obj
[ foreach w words-of o [probe o/:w]
[ ]
== func ['obj [word!] /local o w][o: get obj
foreach w words-of o [probe o/:w]
]
>> f object [a: 1]
*** Script Error: o has no refinement called :w
*** Where: o
*** Stack: f words-of probef rather than a _word_. The function uses the first word (object) as argument, which is a function itself, not an object, hence the protest about a non-existing refinement. What to do to have a better error message? Probably insert assert object? o in the body.[word! (object!)] or somesuch.>> f: func ['w [integer!]][probe w] == func ['w [integer!]][probe w] >> f 1 + 2 1 *** Script Error: + operator is missing an argument *** Where: catch *** Stack:
f 1 + 2 should equal (f 1) + 2 or 3 shouldn't it, and not an error? I put probe on purpose because that gives a result (print yields unset).f eats 1 and + if left with dangling left side, which error message clearly indicates.[word! (object!)] should pass the value of the word bound to a specific object, like a shortcut to using in, or that a lit-word arg is checked for the type it refers to? I assume the latter, but safer to ask.object! value".object! you want to accept (class id, presence of specific fields, etc).forall increments series' index so that you can iterate over it:>> block: [a b c d] == [a b c d] >> forall block [print [block/-1 block/1 block/2]] none a b a b c b c d c d none
increment would be:>> increment: func ['word][set word 1 + get word] == func ['word][set word 1 + get word] >> x: 0 == 0 >> increment x == 1 >> increment x == 2 >> x == 2
>> increment: func [word][set word 1 + get word] == func [word][set word 1 + get word] >> x: 0 == 0 >> increment 'x == 1 >> increment 'x == 2 >> x == 2
mold/flat does not removes line breaks when used with binary! value:>> mold/flat #{FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF}
== {#{^/FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF^/FFFF^/}}>> 1x6 < 2x2 == true
>> sort [1x2 1x1 2x1 2x2] == [1x1 1x2 2x1 2x2]
>> sort [1x2 1x1 2x1 2x2] == [1x1 2x1 1x2 2x2]
single-line-mold mezz that I used a *lot*, for blocks, not binary. We can easily use trim/all on the result of mold, and the current behavior may be useful once system/options/binary-base is in effect, where base-64 output can be created by mold. It overlaps functionality with enbase/base, and I almost always used the latter instead in R2.mold/flat should remove lines, but thinking a bit changed my mind.trim/lines on a block remove new-line markers? That seems useful to me.none values. So we can just stick with new-line/all ... off. foo: function [][do [continue]]
forever [
print "foo"
foo
]root size: 2393, root max: 4271, cycles: 0, before: 1090052, after: 1051316 root size: 2393, root max: 4271, cycles: 1, before: 1087708, after: 1087708 foo *** Runtime Error 95: no CATCH for THROW *** in file: common.reds *** at line: 260 *** *** stack: ***-uncaught-exception *** stack: ***-uncaught-exception
forever is compiled while continue is not. Still, weird error. In the lines of "magic bad" :)prin function only on GUI console (print is ok)>> prin "one^/two^/three" ; no newline at the end
<--- extra newline IF the string contains newline anywhere
one
twothree <--- incorrect output
>> prin "one^/two^/three^/"
<--- extra newline IF the string contains newline anywhere
one
two
three <--- Correct outputRed 0.6.4 for Windows built 25-Sep-2019/22:36:30+03:00 commit #f753e25>> prin "one^/two^/three" one twothree >> prin "one^/two^/three^/" one two three
transform with negative scale-y does not work on Mac OS:view [box 100x100 draw [transform 0 1 -1 0x100 line 0x0 50x20]]
view [box 100x100 draw [translate 0x100 scale 1 -1 line 0x0 50x20]]
return several times in terminal ( or worse: holding it down a few seconds ) causes long delay until >> shows again.copy/deep doesn't work on map!s?>> a: #(b: #(c: 1))
== #(
b: #(
c: 1
)
)
>> x: copy/deep a
== #(
b: #(
c: 1
)
)
>> a/b/c: 2
== 2
>> x
== #(
b: #(
c: 2
)
)>> load probe mold/all %"c:\file" "%c:\file" *** Syntax Error: invalid value at ":\file" *** Where: do *** Stack: load
mold/all is with a permanent TBD flag)%c:\file isn't valid.mold eats inner quotes for some reason.mold [doesn't](https://github.com/red/red/blob/master/runtime/datatypes/file.reds#L163) handle quotations in any way.file!. I'm curious about the design rational behind that, because we have to-red-file and to-local-file. It seems like it kind of muddies the water for me.molded value when it evaluates it?>> %"c:\file" == %c:\file
% normalization.%"::::::::::::"read.%"..." exists in the first place is notational convenience - you can write system-specific path instead of sticking to Rebol convention. As for lexical abusage - I believe most of any-string! values suffer from that, one way or another - doesn't mean we can't leverage it (dialecting comes to mind), like e.g. email! with missing user part turns into @greggirwin ref!-like value.file! form, and the convenience part is not for locality, but for special characters like spaces. Making users type %20 is not human friendly. %"..." is a shortcut for to-red-file "...", so...>> %: :to-red-file () >> %"c:/file" == %c:/file >> % "c:/file" == %/c/file
file! values in such lexical form bear any weight. That's definitely not what you want to keep in your data, as it's non-portable. OTOH, you can keep them for unintentional purposes (dialects) not related to files at all.mold/all should be able to encode *anything* that exists in the interpreter memory. What's it worth if you can't save and load the state as is?%"" notation isn't likely to go anywhere, it should be supported by mold/all as well.file! than making it more flexible.>> %"/c/file" == %/c/file
file! values and quote them accordingly when molded?:>> %1x?_-+=~`!#$&*|,.<> == %1x?_-+=~`!#$&*|,.%3C%3E >> load mold/all to file! " 1x?_-+=~`!#$%&*()|,.<>" == %%201x?_-+=~`!#$%25&*%28%29|,.%3C%3E
: and local Windows format gets special treatment currently, which is likely why colons aren't percent encoded. file! actions provides automagic assistance WRT local file names.>> change-dir to-red-file %"c:\dev" == %/c/dev/ >> change-dir %"c:\dev" *** Access Error: cannot open: %/C/dev/gi/red/build/bin/c:\dev/ *** Where: do *** Stack: change-dir cause-error
file!s relying on the blessed/special Windows format. If we defer the "save/load all state" issue, there are still choices for file!'s molded form: {%"c:\file"}; otherwise use percent encodingto-red-file logic to always produce %/c/file, with percent encodingto-red-file logic *and* sniff for any non-supported characters and return quoted format, not percent encodingview [
index: text-list 300x460
on-alt-down [
view/options
[ text-list data ["a" "b"] ]
[ actors: object [on-unfocus: func [f e] [unview/only f]] ]
]
]-d option, it will also show a VIEW: WARNING: free null window handle! line.on-unfoucs might not be triggered.>> load "4x" *** Syntax Error: invalid pair! at "4x" >> load "4a" *** Syntax Error: invalid integer! at "4a" >> load ".4a" *** Syntax Error: invalid float! at ".4a" >> load "1.0x.0" *** Syntax Error: invalid pair! at "1.0x.0" >> load ".4x" == [0.4 x] >> load ".0x.0" == [0.0 x.0]
Invalid tuple -- .0x.0 on R2.R3> load ".0x.0" == 0x0 R3> load ".1x.3" == 0.10000000149011612x0.30000001192092896
load ".4x".invalid decimal / pair error obj: make reactor! [a: 3 b: 5 sum: is [a + b]] set-quiet 'obj/a 5
set-quiet does not allow word! for its word argument.set-quiet in obj 'a 5set 'obj/a 5 works as expected.set is a beast on which a lot of things hang. While set-quiet serves only the reactivity and View code in a few places. A tiny thing ;)set-quiet support all the features that set supports? If that was the plan, I guess we'd have a refinement /quiet for set, rather than a separate routine.-set-quiet.USAGE:
SET-QUIET word value
DESCRIPTION:
Set an object's field to a value without triggering object's events.
SET-QUIET is a routine! value.
ARGUMENTS:
word [any-type!]
value [any-type!]word is perhaps too broad?>> remainder 10 11.22.33 == 1.2.3 >> remainder 10 11x22 == 1x2 >> remainder 10 make vector! [11 22 33] == make vector! [1 2 3]
f: view/options/no-wait [
t: h5 red 80x20 "Not frozen more"
] [options: [drag-on: 'down] flags: ['no-title]]*** Script Error: path face/state/4 is not valid for none! type *** Where: drag-offset *** Stack: view show do-safe
f: view/options/flags/no-wait [
t: h5 red 80x20 "Not frozen more"
] [drag-on: 'down] 'no-titleset and set-quiet. The latter is even more restrictive, and should be noted IMO.*** Runtime Error 21: guard page *** in file: /C/dev/red/libmicrohttpd/collector.reds *** at line: 61 *** *** stack: red/collector/mark-stack-nodes *** stack: red/collector/do-mark-sweep *** stack: red/collector/do-cycle *** stack: red/alloc-series-buffer 15681 1 0 *** stack: red/alloc-series 15681 1 0 *** stack: red/alloc-bytes 15681 *** stack: red/binary/make-at 0283EDE4h 15681 *** stack: red/binary/load-in 028D8ADFh 15681 00000000h *** stack: red/binary/load 028D8ADFh 15681 *** stack: handler-callback 004F1C00h 42828768 028D8825h 028D8820h 028D8827h 028D8ADFh 02F39E5Ch 028D8404h
recycle/off?set which is the more restrictive one, rather; for set-quiet I would recommend taking over the one for the word argument.recycle/offlibmicrohttpd-12.dll for Windows (x64)? I've downloaded the latest version but it crashed.recycle/off, it happened even for 1 MB file.recycle/off I tested to upload 1, 3, 6, and 17 MB file without an issue.read http://www.slashdot.org fails to you too ?>> s: read http://slashdot.org
== {<!-- html-header type=current begin -->^/^-^/^-<!DOCTYPE html>^/^-^/^-^/^-<html lang="en">^/^-<head>^/^-<!-- Render IE9 -->^/^-<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">^/^/^-..,sites: [ http://www.repubblica.it http://www.virgilio.it/ http://www.slashdot.org ] forall sites [ counter: 0 until [ counter: counter + 1 page: first sites page-text: attempt [read page] either not none? page-text [success: true] [success: false] print ["page: " page " counter: " counter " Success: " success] ; probe page-text counter > 1 ] ]
>> do %prj-vari/dload.r page: http://www.repubblica.it counter: 1 Success: true page: http://www.repubblica.it counter: 2 Success: true page: http://www.virgilio.it/ counter: 1 Success: true page: http://www.virgilio.it/ counter: 2 Success: true page: https://www.slashdot.org counter: 1 Success: false page: https://www.slashdot.org counter: 2 Success: false *** Throw Error: no catch for throw: halt-request *** Where: do *** Stack: do-file >>
page: http://www.repubblica.it counter: 1 Success: false page: http://www.repubblica.it counter: 2 Success: false page: http://www.virgilio.it/ counter: 1 Success: false page: http://www.virgilio.it/ counter: 2 Success: true page: http://www.slashdot.org counter: 1 Success: true page: http://www.slashdot.org counter: 2 Success: true
read relies on the OS API.invalid UTF-8 encoding>> read http://www.virgilio.it/
*** Access Error: invalid UTF-8 encoding: #{A04C40ED}
*** Where: read
*** Stack:
>> read http://www.virgilio.it/
== {<!DOCTYPE html>^/<html class="" lang="it-IT">^/<head>^/ <meta charset="utf-8">^/...
>> read http://www.virgilio.it/
*** Access Error: invalid UTF-8 encoding: #{F7000000}
*** Where: read
*** Stack:
>> read http://www.virgilio.it/
== {<!DOCTYPE html>^/<html class="" lang="it-IT">^/<head>^/ <meta charset="utf-8">^/...open tcp://:8001 throws an error;*** Access Error: scheme is unknown: make object! [scheme: 'tcp user-info: none host: "" port: 8001 path: none target: none query: none fragment: none ref: tcp://:8001] *** Where: open *** Stack:
Accept-charset: utf-8 in the http request?read write http://www.virgilio.it/ [GET [Accept-charset: "utf-8"]]set [code header data] write/binary/info http://www.virgilio.it/ [GET [Accept-charset: "utf-8"]]
charset=UTF-8 before converting data to string>> write http://www.virgilio.it [GET [Accept-charset: utf-8]] *** Runtime Error 1: access violation *** in file: /X/GIT/Red/red/runtime/unicode.reds *** at line: 737 *** *** stack: red/unicode/to-utf16-len 03788A74h 0019FAD4h true *** stack: red/unicode/to-utf16 03788A74h *** stack: red/simple-io/request-http 122 02831B14h 03788420h 00000000h false false false *** stack: red/url/write 02831B14h 00000000h false false false false 02831B04h 02831B04h 02831B04h 02831B04h *** stack: red/actions/write 02831B14h 02831B24h false false false false 02831B04h 02831B04h 02831B04h 02831B04h *** stack: red/actions/write* -1 -1 -1 -1 -1 -1 -1 -1 *** stack: red/interpreter/eval-arguments 0292FD24h 037882F0h 037882F0h 00000000h 00000000h *** stack: red/interpreter/eval-code 0292FD24h 037882D0h 037882F0h false 00000000h 00000000h 0292FD24h *** stack: red/interpreter/eval-expression 037882D0h 037882F0h false false false *** stack: red/interpreter/eval 02831AE4h true *** stack: red/natives/catch* true 1 *** stack: ctx||543~try-do 00EC08E0h *** stack: ctx||543~do-command 00EC08E0h *** stack: ctx||543~eval-command 00EC08E0h *** stack: ctx||543~run 00EC08E0h *** stack: ctx||543~launch 00EC08E0h
Darwin Daniels-MBP.local 19.0.0 Darwin Kernel Version 19.0.0: Wed Sep 25 20:18:50 PDT 2019; root:xnu-6153.11.26~2/RELEASE_X86_64 x86_64
>> v: make vector! [1 2 3 4] >> insert/part v v 2 *** Script Error: invalid argument: make vector! [1 2 3 4] *** Where: insert *** Stack:
>> replace "1234" "2" "5" == "1534" >> replace "1234" 2 5 == "1234"
/part that's why I ask:>> v: make vector! [1 2 3 4] == make vector! [1 2 3 4] >> insert v 0 == make vector! [1 2 3 4] >> v == make vector! [0 1 2 3 4]
part with integer works, should check with series.>> v: make vector! [1 2 3 4] == make vector! [1 2 3 4] >> insert/part v [5 6 7 8] 2 == make vector! [1 2 3 4] >> v == make vector! [5 6 1 2 3 4]
value is of vector! type. Disregard what I said about /part :)>> insert v make vector! [1] *** Script Error: invalid argument: make vector! [1] *** Where: insert *** Stack:
replace, changing this line https://github.com/red/red/blob/master/environment/functions.red#L236if system/words/all [any [char? :pattern tag? :pattern] any-string? series] [if system/words/all [any [not any-string? :pattern tag? :pattern] any-string? series] [pattern is a block.if system/words/all [not block? :pattern any [not any-string? :pattern tag? :pattern] any-string? series] [FIX: #4079.parse/trace?>> parse [a a a] [1 5 word!] == true >> parse/trace [a a a] [1 5 word!] func [e m? r i s][] == false >> parse/trace [a a] [1 5 word!] func [e m? r i s][] == true
parse-trace is different from parse. Must be some stack problems as usual.no or none from trace func, the result of parse is always yes regardless of the inputprobe the parameters? What fails?parse/trace.parse/trace [a a a] [1 3 word!] func [e m r i s][print ["event:" e newline "match:" m newline "rule:" mold r newline "input:" mold i newline "stack:" mold s newline] true]input should be empty, but it is not (is it input: [a] so it fails)/file argument to request-file, which may be a directory, is not "normalized" by the function request-file. As a consequence, request-file/file %., which to me means "start looking in the current directory" is not honored - one has to do request-file/file normalize-dir %. The usual question: _bug or feature_?%. and %... Easier to add a slash than make a special case in R/S for adding a slash, right?ls and dir _do_ accept %. as a directory, as does change-dir or cd. Then why not request-file???dirize the argument. While request-file uses the part after the last slash as a suggested file name. It only doesn't makes sense for the two special cases above.request-file calls clean-path on its /file argument... would that break anything? It seems like it would resolve the %. and %.. cases at least./file arg ends up in the filename box at the bottom, rather than going into that dir.Clean-path is due for a design check anyway: https://github.com/red/red/issues/3571red binary executes console for actual code evaluation but does not handle exit code properly, as resullt quit and quit-return does not affect actual return code of red binary.console and execute console directly?red always exits with an explicit 0: https://github.com/red/red/blob/15b13004d3263ad0a9182be6bcb851b77346f653/red.r#L510request-file/filter ["MD files" *.md]
*** Runtime Error 98: assertion failed *** in file: .../runtime/ownership.reds *** at line: 226 *** *** stack: red/ownership/check 00000062h 00433F22h 0000000Ah 51725288 46280020 *** stack: red/ownership/check 02C22D54h 02C0DAF4h 00000000h 0 0 *** stack: red/string/take 02C22D54h 02C22D34h false false *** stack: red/actions/take 02C22D44h 02C22D34h false false *** stack: red/actions/take* -1 -1 -1 *** stack: ctx||563~delete-text 00BAF5CCh *** stack: ctx||563~press-key 00BAF5CCh *** stack: ctx||543~on-key 00BAF7ACh *** stack: red/_function/call 02C22C44h 00BAF7ACh *** stack: red/interpreter/eval-code 02C22C44h 03072540h 03072540h false 00000000h 00000000h 02C22BA4h *** stack: red/interpreter/eval-expression 03072520h 03072540h false false false *** stack: red/interpreter/eval 02C22C34h true *** stack: red/natives/do* false -1 -1 -1 *** stack: red/interpreter/eval-arguments 02DA04B4h 030724FCh 030724FCh 00000000h 00000000h *** stack: red/interpreter/eval-code 02DA04B4h 030724ECh 030724FCh false 00000000h 00000000h 02DA04B4h *** stack: red/interpreter/eval-expression 030724ECh 030724FCh false false false *** stack: red/interpreter/eval 02C22C14h true *** stack: red/natives/try* true 0 *** stack: do-safe *** stack: do-actor *** stack: ctx||403~awake 00BB2D00h *** stack: gui/make-event 0019FDD4h 0 13 *** stack: gui/process 0019FDD4h *** stack: gui/do-events false *** stack: ctx||411~do-event-loop false *** stack: do-events *** stack: ask *** stack: ctx||503~run 00BB053Ch *** stack: ctx||503~launch 00BB053Ch *** stack: ctx||535~launch 00BAF7F8h
rcalc.red on commandline. built from source yesterday. can anyone confirm?[attempt[m: m + math to block! load v/text]]?[attempt[m: being what caught my eye first./helproom). I think I found out an asymmetry between infix and prefix functions: >> fns: reduce [:add :subtract] == [make action! [["Returns the sum of the two values" ... >> type? pick fns 1 == action! >> fns/1 2 3 == 5 >> ops: reduce [:+ :-] == [make op! [["Returns the sum of the two values" ... >> type? pick ops 1 == op! >> 2 ops/1 3 == 3 ;; not 2 + 3 i.e. 5
op! value). Apparently, the compiler and interpreter require a word! that is bound to the op! value. If this, as I suspect, is a feature, not a bug, it needs to be pointed out somewhere.op! value that could be applied. Making a function that yields an op! value does not work, but neither does making a function that yields an action! value -- only words and paths seem to work for actions! etc., and paths do not work for op! values. Which other expressions could one invent that yield an action! etc. or an op! that could then be applied? Or are we stuck with bound words only? Admittedly computing the action/op to be applied from an expression does not enhance readability...[3 make op! .. 4]Red [needs: 'view] new-font: make font! [size: 60] view [ base 500x500 white draw [font new-font pen black text 2x2 "Hello World!"] ]
-c on Windows 7 and red-02nov19-1d32938a.exe:-=== Red Compiler 0.6.4 ===- Compiling Z:\wallet2.red ... ...using libRedRT built on 7-Nov-2019/12:36:23 ...compilation time : 7799 ms Target: MSDOS Compiling to native code... *** Compilation Error: undefined symbol: red/file/to-OS-path *** in file: %/Z/runtime/platform/image-gdiplus.reds *** in function: exec/gui/OS-image/load-image *** at line: 459 *** near: [file/to-OS-path src :handle if not 0 = res]
libRed*.* before compiling, right?-u flag.-u is that it compiles longer, just like -r. I thought about some indicator inside libRedRT, that a Red compiler could check. Git commit perhaps. Nevermind, just need to remember about that. It's just a plain convenience.-u would be useless, when -c could check libRedRT version and recompile if it's not in the needed version .-c, toolchain takes a [list](https://github.com/red/red/blob/master/system/utils/libRedRT-exports.r) of exported runtime functions, then quickly [skims](https://github.com/red/red/blob/master/system/utils/libRedRT.r) thru R/S compiler output, looking for user-specific runtime calls, then compiles a runtime library which _specifically_ includes all the above functions.file/to-OS-path, then toolchain will rightfully complain, because your (now outdated) runtime library has no exported symbol with such name, which means that you need to --update-libRedRT it.-u is the slowest compilation version because it does a triple job: analyze user-specific needs, rebuild the library, and then compile a binary.-u.-c) against it? (until I download a new build)about -- turns out that system/platform is a function whose body is Red/System, and the interpreter refuses that, as it should. But with a clean GUI console I can do about without any problem -- how come?system/platform) was a *compiled* function, in the clean GUI console.system/platform should not be passing in the interpreter.system/platform, and so it switchedsystem: make system [] so that must explain it. Thanks for thinking with me.#get system/... references in the Red runtime library, so recreating the system object would lead to odd side-effects at best, resulting in crashes most probably at some point.extend system [] , once it will be implemented, not lead to "recreating" the object??#get or other indirect ways to access the object (like from object's context node). The only reason extend is not implemented on objects yet, is that people will abuse it to create dynamic objects everywhere, and I need first to study the implications of such misuses. ;-)user to the system object, in analogy with Rebol 2. The information would be used to program a send-mail function (which itself would depend on the implementation of ports) but I believe it would be generally useful to have system/user information, which could be persistent by storing it in AppData (i.e. system/options/cache more generally), just as console configuration info is now stored. I will make a REP for this.user refer to? Email? Any personal information is rather sensitive to handle lightly these days...send which does send mail.save. On MacOS I have observed for several weeks:save afile anobject and anobject: do load afile.anobject contains amongst some fields a map as last item. This map can contain 1000s of entries.load fails like here:*** Syntax Error: missing #"]" at "^B]" *** Where: do *** Stack: show-price load
)] save seems to insert a wild character at the end. Any suggestions?;SAVE-O -------------------------------------------------------------------------------
save-o: function [
"save all object values to file %name.obj (creates dir if necessary)"
path [file!]
][
save-obj: context [
last-id: 0
formatting: none
extra: none
data: none
]
save-obj/formatting: self/formatting
save-obj/extra: self/extra
save-obj/last-id: self/last-id
save-obj/data: self/data
unless (last path) = #"/" [
append path #"/"
]
f: rejoin [path name ".obj"]
unless exists? first split-path f [
create-dir first split-path f
]
save f save-obj
]; save-o^B is char 2, so maybe that's something @qtxie can use to narrow the possibilities. mold the object to a temp string, and if you see that the file is corrupted, see if the string has the same problem.2388 [12-Nov-2019 12687.173928273272 13385.326649706762 13025.322960122394 12674.443657478358 12993.409953822376 14025.119190805652 13419.106064414165]
2389 [13-Nov-2019 12863.003231554487 13302.571699813932 13073.38083829998 12689.637829467767 12952.15845130321 13993.343448125132 13445.488164615113]
)]2389 [13-Nov-2019 12863.003231554487 13302.571699813932 13073.38083829998 12689.637829467767 12952.15845130321 13993.343448125132 13445.488164615113]
)ú]dehex does not accept hex values greater than 7F. In Rebol2 dehex "%E9" is e acute (é), whereas in Red, it remains "%E9".C3A9, which is even stranger...de-hex: func [hex][
to-char to-integer load rejoin [
"#" head insert next "{}" pad/left/with copy next hex 8 #"0"
]]
de-hex "%E9"
;== #"é"de-hex: func [hex /low][
hex: copy next hex
if any [low 2 = len: length? hex] [
hex: pad/with/left hex 8 #"0"
]
hex: load rejoin ["#" head insert next "{}" hex]
to-char either any [low len = 2] [to-integer hex][hex]
]
>> de-hex "%E9"
== #"é"
>> de-hex "%C3A9"
== #"é"
>> de-hex/low "%C3A9"
== #"쎩"=XX. I found the same workarounds.load rejoin ["#" head insert next "{}" hex] there should be debase/base hex 16 of course. :flushed: )Ò] was in one of two saved files (same code, just different data).Ò character (using an editor) both files could be loaded again.Red 0.6.4 for macOS built 17-Nov-2019/2:22:27+10:00 commit #88b3ff0-t windows.Rebol3:>> parse "aabb" [some [#"a" reject] copy rest to end] rest == "abb"
Red:>> parse "aabb" [some [#"a" reject] copy rest to end] rest == "bb"
>> parse "aabb" [some [#"a" reject] copy rest to end] rest *** Script Error: rest has no value *** Where: catch *** Stack:
rest should never be set. reject key word correctly... what is difference between reject and fail?fail set a flag that after leaving [] block it should stop. But when it reached that, "b" was already processed and it returned true because the input is at the end.fail will stop parsing not matter how deep inside the rule is and simply return false.saveit: does [
dbsave: to-block db
save %db.txt dbsave
dbsave: copy []
]>> saveit >> saveit >> length? db2: load %/a/db.txt == 75000 >> db2 == ["user1" "pred1" "val1" "user2" "pred2" "val2" "user3" "pred3" "val3" "user4" "pred4" "val4" "user5" "pred5" "val... >> db == ["user1" "pred1" "val1" "user2" "pred2" "val2" "user3" "pred3" "val3" "user4" "pred4" "val4" "user5" "pred5" "val... >>
>> aboutfast-lexer).git can manage without manual intervention?field, it's a field on any platform, so it can be tested.test backend on the other hand will test itself, not the real behavior of other backends, so I do not consider it perspective.base-self-test, did it? And it was fairly simple :)base-self-test tests at the office?call/wait reform [encapper "precap.r -o" bin/:red]
o: make string! "" call/wait/output reform ["cmd&" encapper "precap.r -o" bin/:red] o
call issue didn't appear after this commit https://github.com/red/red/commit/6aa92f6afe50772f82586e8e58e53e458841a9b3 call/show "" almost all my R2 scripts because eventually I use call.prime-call-console func that initiates it that way once if call is used. Some of those scripts can be called a *lot*, and this avoids the overhead and flashing window if it ends up not being used. copy/part could work with negative pairs too, to be consistent with negative integers. Now:>> i: make image! 4x4 copy/part tail i -2x-2
== make image! [0x0 #{}]-r, it crashes when I: start it, click the button, close it.*** Runtime Error 1: access violation (and the same error dump as reported, with -d)image! copy action, yes? I don't see a reason not to do that. e.g. imagine selection/cropping features in drawing GUIs. Easy enough to use sort as well, if we find there are issues with this.func native does not copy the spec block like function native does:>> s1: [a b] s2: [a b] f1: func s1 [] f2: function s2 [] append s1 'c append s2 'c == [a b c] >> :f1 == func [a b c][] >> :f2 == func [a b][]
gui-console-2017-8-3-49893.exe from Windows Security scan just now. Want the details?help at this time.Red 0.6.4 for Windows built 20-Dec-2019/19:03:46+03:00 commit #544a6e1 GUI console crashed twice during 2 days on totally normal code. It's left idle for hours then I come, copy+paste some snippet and it closes. I'll switch to debug builds in hopes that the bug will produce some output.