Archived messages from: gitter.im/red/bugs from year: 2019

hiiamboris
21:24
>> view [base on-created [probe event]]
none
>> view [base on-create [probe event]]
none

it's a bug, right?
endo64
21:30@hiiamboris Nope, it is not. See 11.3. Actors section of https://doc.red-lang.org/en/view.html#_events
21:30> Unlike other actors, on-create has only one argument, face.
hiiamboris
22:13what about on-createD ?
22:14well, no wonder now these events are not caught by insert-event-func...
23:28also, how about this?

view [p: panel [f: field] do [selected: f]]

sets focus to f although f is not a part of window's pane

and what seems to be the proper way:
view [p: panel [f: field] with [selected: f] do [selected: p]]

loses focus totally
23:33what's more surprising, is that 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

although it should by the look of it:
>> ?? 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]
23:36nvm, I got the whole idea wrong it seems...
so there is only one selected facet that matters, and it's the one of window face, others are only taking memory

dockimbel
02:02@hiiamboris A window can only have one selected face at a time.
hiiamboris
02:25Technically yes, but for some reason I thought of selected 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.
dockimbel
02:35@hiiamboris Makes sense, that's a feature that could be easily implemented, just set-focus to selected face in a tab-panel when shown.

GiuseppeChillemi
22:09Hi, I am writing some code for URI to internal-path conversion and while coding a function (I am in the early stages) I have found I lose a word value inside a function and I don't realize the reason:

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


OUTPUT:

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 
>>


LEVEL is NONE inside a function while it shoudn't
9214
22:19> I don't realize the reason

The reason is that you use 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]


And please use a [dedicated room](https://gitter.im/red/help) if you have troubles with your code.
GiuseppeChillemi
22:34@9214 , thought it was a BUG, moving to /help

hiiamboris
00:31@dockimbel regarding :point_up: [January 6, 2019 1:06 PM](https://gitter.im/red/red?at=5c31d3371948ad07e8f8151e)
Does it always fail for you? If so, maybe @qtxie can tell what assertions fail there and why?
I've installed this monstrous W10 in a VM, but couldn't reproduce it.
![](https://i.gyazo.com/50d914e4e36f9fccaadbcf80a771d0b3.png)
00:41But, if it was just a sudden glitch, don't bother. Decreasing rate https://github.com/red/red/blob/master/tests/source/view/base-self-test.red#L51 from 2 to 1 should fix it then.
qtxie
02:21@hiiamboris I'm using W7 and all the tests are passed. I'll give a try on W10 today.
dockimbel
02:30@hiiamboris It consistently fails on my main development box running W10. My screen resolution is uncommon (3000x2000), so I'm wondering it that would be a possible cause? I will try again with that decreased rate.
02:32I'm no fan of W10 either, but W7 does not handle properly very high resolutions.
hiiamboris
04:24When it fails, does it show you the actual screenshot and what it expected and what it gets? (it should for 5 secs, defined here https://github.com/red/red/blob/master/tests/source/view/base-self-test.red#L46)
dockimbel
04:28Even with the different setting, the two same tests are still failing:
~~~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****************
04:29@hiiamboris I haven't noticed, it opens/closes a lot of windows and the whole process takes a long time (seems like 5-10mn, but haven't measured).
04:30I can retry with a longer delay for the failed images.
hiiamboris
04:59Hmm, curious. Well, these 2 tests come before the "lots of windows" part. Just comment everything that comes after.
dockimbel
06:38[![image.png](https://files.gitter.im/red/bugs/iL7R/thumb/image.png)](https://files.gitter.im/red/bugs/iL7R/image.png)
06:39So, it's the 200% scaling in my W10 display settings that makes it fail.
hiiamboris
07:13@dockimbel can you tell your system/view/metrics/dpi value?
07:14if you have 200% scaling it should be = 192
07:14so I guess we're onto something here...
07:15I have
>> system/view/metrics/dpi
== 120

for 125% scaling
dockimbel
07:30@hiiamboris 192 confirmed.
hiiamboris
07:33even weirder then!
Apparently 192 never gets to this line https://github.com/red/red/blob/master/tests/source/view/base-self-test.red#L1028
07:33Either something overrides it, or it's wrong when the test runs
dockimbel
07:36Let me try to probe it in the test to see what's happening...
07:43
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

gives me 96...
hiiamboris
07:45I'll leave it up to you to find out why :)
Can't really test anything on that W10. It just constantly keeps torturing my HDD for no reason, takes 10 minutes to login.
dockimbel
07:46I think the View engine is not initialized yet when that code is running, because view hasn't been called once. See: https://github.com/red/red/blob/master/modules/view/view.red#L835
hiiamboris
07:47I have a proper dpi value even in CLI-console.
dockimbel
07:48So the DPI is not set yet and falls back to the default 96 value.
07:48Odd...
07:50@hiiamboris
> I have a proper dpi value even in CLI-console.

How is that possible? It's only set when view is called the first time...
hiiamboris
07:52How would I know? I just run red --cli or the console compiled with needs: view and there's my proper DPI
07:57To eliminate consoles:
rebol --do "do/args %red.r {-c -t MSDOS 1.red} quit"

1.red: Red [] probe system/view/metrics/dpi
D:\devel\red\red-src\red>1.exe
120
07:58Interesting though, -r gives
*** Runtime Error 1: access violation
*** at: 00436005h
08:03Should I raise a new issue regarding this crash?
dockimbel
08:03@hiiamboris What is in 1.red?
hiiamboris
08:03Red [] probe system/view/metrics/dpi
dockimbel
08:05Yes, you can open a new issue.
08:06
lisp
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

That's odd...
hiiamboris
08:07Just compiled with -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

So it looks like indeed the View wasn't initialized with -r. Seems to me, view isn't the only trigger that inits it.
dockimbel
08:14@hiiamboris Can you change the scaling on your W7 and see if the tests are still passing?
hiiamboris
08:16I have 125% by default (dpi=120), and they are passing.
08:19I bet they will pass if you add 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).
dockimbel
08:34@hiiamboris
> I have 125% by default (dpi=120), and they are passing.

I mean change it from your default setting, to see if you can reproduce the issue.
hiiamboris
08:34Default is 100%, dpi=96
08:34You mean to 200%?
dockimbel
08:34On Qingtian's W10, it works fine with 125% too and starts reporting errors if that scaling is changed to anything else.
hiiamboris
08:35I was also thinking. The 2nd test fails again on 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.
08:37I have 200% on my W8, and I tested that on it as well before I made a PR.
08:49Just tried again, with run-test.r and tests/run-all.r, both work with 200% on W8.1.
PeterWAWood
08:53Wouldn’t it be sensible to use the test-backend to both confirm the tests work and so that they can be run by the CI?
hiiamboris
08:56Nope. Test backend tests itself, not the *real* backend. Pointless for this task.
dockimbel
09:18@hiiamboris
> Just tried again, with run-test.r and tests/run-all.r, both work with 200% on W8.1.

Thanks, we'll investigate further the surprising DPI init issue.
mikeparr
15:55@greggirwin - unique suggestion - got it - thanks.

Dobeash
21:46> Trim now supports binary! values. By default, only null values are removed.

>> trim/with #{00} null
== #{}

works.
>> trim #{00}

hangs console.

greggirwin
00:21Confirmed and commented with more info on the ticket.
hiiamboris
11:26I have such a wonderful crash.. that happens only on GUI console compiled with -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...
12:56Also reactions disappearing for reasons unknown (not affected by the GC)... ☺
13:17@dockimbel The last line is a bug, yes? /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
Oldes
23:04@dockimbel I was just playing with image creation and found this:
>> 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}]

1. I suppose lexer should recognize i/1x1 like it recognize i/(1x1), right?
2. Is it by design that the access using pair is _one based_? In Rebol it was _zero based_.
23:17I'm inclined to believe it is good decision as it works with possible 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.
23:30This is what I would like to have:
img: make image! size: 100x100
repeat p size [
	img/:p: random 255.255.255
]
23:40(and I know that I could do above more efficiently using integer accessor)
23:49Another reason why the Red behaviour is probably better is, that random PAIR is giving 1-based values.

hiiamboris
01:15@Oldes https://github.com/red/red/issues/2500
I reported that too a month ago.
01:18Regarding 0x0 vs 1x1, if you want my opinion, I'm *always* against 1-based indexing. Also here https://github.com/red/red/wiki/[PROP]-Image-coordinate-systems-reboot-idea (see 1.) I posted some criticism about it.
greggirwin
05:32@dockimbel @qtxie, be sure to read @hiiamboris 's article, if you haven't already.
qtxie
05:50I think the CS-2 is not necessary. The cordinate system in View and Draw is not pixel based.
dockimbel
06:36@hiiamboris Thanks for the in-depth analysis! I love the drawings. ;-) Few quick comments:
* The 0 vs 1-based indexing is a deep topic. If image/0x0 gives you the first pixel, and pick image 1 (== first image) the first pixel also, we fail at consistency.
* The underlying image and 2D vector library can also impose some constraints (I remember some off-by-one issues between GDI and GDI+), a new "reboot" has to take them into account.
07:11@Oldes
> 1) I suppose lexer should recognize i/1x1 like it recognize i/(1x1), right?

No, those are different lexical constructs, parens are allowed in paths (for now), so anything that fits in a paren will pass. If you remove the parens, then you are branching in a different branch of the lexer. Adding pairs support in paths needs a good supporting use-case. Paths have strong lexical constraints, they are not as flexible as lists types. Here is an example of the kind of problem it can create in R3:
>> [i/1x1:]
** Syntax error: invalid "time" -- "1x1:"
** Near: (line 1) [i/1x1:]



> 2) Is it by design that the access using pair is _one based_? In Rebol it was _zero based_.

It is. In Rebol, you get 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...
greggirwin
17:08And also where explanatory docs will go a long way.

Oldes
11:51Using integer to set image's pixel color is producing invalid result:
>> i: make image! 2x2
== make image! [2x2 #{FFFFFFFFFFFFFFFFFFFFFFFF}]
>> i/1: 0
== 0
>> i/2: 255
== 255
>> i
== make image! [2x2 #{050000050000FFFFFFFFFFFF}]

In 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.
hiiamboris
11:55@Oldes you should update. We've fixed it some time ago.
Oldes
11:56grr... again too late:) And so what is the result now?
hiiamboris
11:56An error.
Oldes
11:56Hm. Why not the gray color?
hiiamboris
11:58Idk. To me it doesn't look like this use case is worth supporting it.
12:02@Oldes there was no code that handles special cases. It accepted any spam and produced totally invalid results. I just added a check for supported types, that's all. If you think gray color is worth it, let's discuss it. But personally I'd rather convert the integer to a 4-byte tuple (like i/1: to-tuple to-binary 1).
12:03https://github.com/hiiamboris/red/commit/d0bd8b52ca73e1886462893b4406aa0e93343ee9
endo64
12:05It would better keep the alpha value.
Oldes
12:06@endo64 so to maintain Rebol2 compatibility? That would be better than error indeed.
hiiamboris
12:11i/2: 1.1.1 * 200 is your gray
12:11i/2/4: alpha isn't working unfortunately
Oldes
12:12I think it should work like in R2 as it is the cheapest way to change the alpha channel per pixel.
hiiamboris
12:13Are there many use cases where you specifically want to change the alpha value of many pixels?
Oldes
12:16I think that not much, but there can be. And this is easy to implement and avoids ugly and not efficient code like you provided above with double conversion.
12:16Which is wrong as it changes also the color and not just alpha.
hiiamboris
12:18But that code sets the whole argb 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 ☺
Oldes
12:22Yes.. your code is wrong as it sets the whole argb, but user may want to change just the alpha. How you would do it now?
hiiamboris
12:23And I may want to change whole argb
If I want just alpha, then x: i/2 x/4: alpha i/2: x or i/2: i/2 * 1.1.1 + (0.0.0.1 * alpha)
Oldes
12:24Right... as I said.. ugly and not efficient... in rebol2 it was just i/2: alpha
hiiamboris
12:24Why alpha then? Why not blue channel? Or green?
12:26Anyway, I'm not against it. Just never had a use case, so I'm not gonna bother myself.
Oldes
12:26Sorry... I end now... this question is a nonsense for me. I just say, that Red has another easy to fix in-compatibility with Rebol2
meijeru
13:56@hiiamboris @Oldes In contrast to you, I consider this a serious issue and will make a ticket.
15:18#3729
Oldes
19:09One more image related question... should not pair selector respect image size?
>> i: make image! 4x4
== make image! [4x4 #{
    FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
    FFFFFFFFFFFFFFFFFFF
>> i/(6x1)
== 255.255.255.0 ;<- should not it be none?
endo64
19:13It is none for me:
>> i: make image! 4x4
>> i/(6x1)
== none
19:13On Win10 (Red 0.6.4 for Windows built 11-Jan-2019/5:18:27+03:00 commit #5e37a10)
Oldes
19:14Grr.. I'm again in wrong (old) folder
Dobeash
21:14I see that 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"]
endo64
21:55@Dobeash I think yes, for R2/R3 compatibility you can raise a ticket, or you can directly make that change and send a pull request.
greggirwin
22:24We can probably just switch to 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
    ]
]
endo64
22:25Yep, exactly.

Oldes
10:59It looks that initialization of 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]]
11:02Or maybe there could be some flag which could specify which endianness to use (which could be used also when converting vector back to binary)?
meijeru
11:06@Oldes The use of binary values for initialization is not implemented. I agree there should be an error. If you really need the facility, you could make a wish.
Oldes
11:08I would rather like to know if this is something what anybody else like (because I think that 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.
11:21Current vector initialization DSL simply ignores anything following the length info:
>> make vector! [integer! 16 2 blabla]
== make vector! [integer! 16 [0 0]]
hiiamboris
11:29I'd like to see vectors filled with a given init value. Especially, of non-integer type.
greggirwin
19:58It would be good to start a design chat for that, either in the main Red room, with someone keeping notes in a doc, or in a wiki page, or have someone champion it in a REP. You can't use 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.
rebolek
20:25There's https://gitter.im/red/red/vector-datatype room for it.
Dobeash
21:06Is this a known issue?
; R2/R3
>> to time! "1:00PM"  
== 13:00
; Red
>> to time! "1:00PM"
== 1:00:00
greggirwin
21:22Thanks @rebolek.
endo64
21:49@Dobeash I don't think so. Would it be a wish ticket instead of a bug (compatibility) report.
We can note that in https://github.com/red/red/wiki/%5BDOC%5D-Differences-between-Red-and-Rebol
Also
>> to time! "13:00PM"
== none ; R2
== 13:00 ;Red
== Error ;R3
greggirwin
21:52
>> load "13:00PM"
== [13:00:00 PM]
21:53So you can see how it is currently lexed. Meridian designations are not part of the time! form, as spec'd: https://doc.red-lang.org/en/datatypes/time.html#_literal_syntax
21:55+1 for noting it in differences.
21:59Note, also that any time value past 12:59, with PM attached, returns none in Rebol if to is used. It lexes as an error there. Same in reverse, for 13:00 to 24:00 with AM attached.
endo64
21:59Noted https://github.com/red/red/wiki/%5BDOC%5D-Differences-between-Red-and-Rebol#to-time
greggirwin
22:12This is one of those things that seems really nice to support, at a glance, but hits limits pretty quickly. The normal form for times won't use it, and you can't trust users to get it right, to just load data, so it's value only comes if Reducers are writing the values directly, which doesn't seem enough to justify supporting it. We could start with some helpers, and see what forms people think are most useful.

gltewalt
04:20Vector is next up.
hiiamboris
10:07@dockimbel can you take a look at https://github.com/red/red/issues/3739 ?
dockimbel
10:28@hiiamboris Sure. I'm glad to see more people looking and playing with the reactive framework as it is a really new approach in the Redbol world. I am wondering also if we should have a debug function that will pretty-print the whole graph in text or graphic mode, as it would be really helpful. The current dump-reactions function is too limited.
10:49@hiiamboris Gave you a quick workaround and review in the ticket.
hiiamboris
10:54@dockimbel Thank you. React is currently quite unreliable because of this. I hope you can fix it. Graph visualization idea is great indeed! I might take on it sometime later...
11:02system/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...
dockimbel
11:35@hiiamboris Memory address? It's all at Red level, not at R/S level. A series buffer address in memory wouldn't be helpful.
hiiamboris
11:44I see. Well, then there's no tool like the old-fashioned print ☺
nedzadarek
11:46@hiiamboris Graph visualization would be **HUGE** help for understanding reactivity.
rebolek
11:48is it something that can be done in userspace?
dockimbel
11:49@rebolek The whole reactive engine is ~300 lines of pure Red code. It relies on object's events to detect changes.
11:50https://github.com/red/red/blob/master/environment/reactivity.red
rebolek
11:52So it could be, I guess. And it could help me to get more familiar with the reactivity in Red.
hiiamboris
11:53Okay. Maybe we could even hook to it to make live step by step overview of events as they happen.
rebolek
11:54Hmm.
hiiamboris
11:55I mean, on a graph. In a separate window probably.
dockimbel
11:55@hiiamboris
> Okay. Maybe we could even hook to it to make live step by step overview of events as they happen.

That is what 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.
11:59@hiiamboris
> I mean, on a graph. In a separate window probably.

That would be really helpful, and a good candidate for a console plugin app (once we get that plugin API out).
xqlab
13:52
-== 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

same on windows and with some
hiiamboris
13:59Confirmed
*** 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
nedzadarek
15:45@xqlab @hiiamboris
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.

dockimbel
01:13@nedzadarek Good finding! Please add it to the ticket.
lepinekong_twitter
10:53Don't know if it is a bug but it's really annoying: when creating a folder, it is locked if we are in that folder for renaming it in vscode for example.
nedzadarek
11:09@dockimbel [done](https://github.com/red/red/issues/3740#issuecomment-455133906)
hiiamboris
13:16I've been looking at the definition of is~ function...
1) It collects 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?
2) It ignores set-paths, likely letting react deal with those, but will create (useless) reactions from any other path type:
>> a: make reactor! [x: 1]
>> b: make reactor! [x: 1 y: is [a/x * 2]]

creates 2 reactions: one from 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).
3) This is an intended backdoor to force the initial value?
>> a: make reactor! [x: 1]
>> b: make reactor! [y: is [[3] 2 * a/x]]
== make object! [
    y: 3
]
toomasv
13:32Seems to be scroller bug for panel with vertical scroller (W10). It shows event/key names for horizontal bar while clicking on vertical:
view [panel with [flags: 'scrollable] on-scroll [probe event/key]]
hiiamboris
13:54Hmm. Is scrollable even working? On W7 it seemingly only harms the GUI console.
endo64
14:26Also ? or, ? not etc. works but ? is doesn't *** Script Error: is operator is missing an argument
hiiamboris
14:42It's because is takes its left operand literally.
endo64
14:44>> ? + also works.
nedzadarek
15:18@hiiamboris
:+1:
>> f: make op! func ['a b] [42]
== make op! [['a b]]
>> ? f
*** Script Error: f operator is missing an argument

Oldes
15:44@dockimbel should not be possible to use _accessors_ (which are defined in system/catalog/accessors) also as a field argument of reflect action? Or what are your future plans for reflect?
toomasv
16:05@hiiamboris scrollable works nicely with some other faces I have tried, e.g. rich-text and base.
Oldes
22:00Is this expected behavior:
>> make-dir %test
== %test/
>> read %test/
== []
>> read %test
*** Access Error: cannot open: %test
*** Where: read
*** Stack:

Strange is, that it is different to:
>> 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/...
dander
22:35@Oldes that is interesting. It seems like one difference to them is that %. 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
>>
Oldes
22:37dir? 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]
dander
22:39I just mean if read has a special case for %., then dir? should as well (or vise versa)
Oldes
22:40The dir? is fine... but read %test should be same like read %test/ if the directory exists.
22:41Strange is, that it works for %.. and %.. Probably because (as you say) it must be directory.
dander
22:48I guess you are right that dir? behavior can be different because it doesn't perform any access to check

greggirwin
01:54@hiiamboris more good research. Please add notes to https://github.com/red/red/wiki/%5BDOC%5D-Reactivity so we can track, and @dockimbel has a single reference source for what we know.
01:57Consistency makes sense for dir? and special cases. It can easily check for those.

> but read %test should be same like read %test/ if the directory exists.

@Oldes why should it do that? And should it only work if a %test file doesn't also exist? %. and %.. are special cases, which *look* like filenames, but are widely standardized as directory names.
hiiamboris
04:57%test file cannot *also* exist where %test/ directory exists
greggirwin
06:33I thought some OSs allowed it. If not, my mistake.
06:34May be a case sensitive thing as well.
hiiamboris
08:22@greggirwin where did your [get-word PR](https://github.com/red/red/pull/3148) go? Last change to 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.red
08:48Regarding https://github.com/red/red/wiki/[DOC]-Reactivity#issue-with-panels-as-reactive-sources
I don't understand why you put bugs into wiki, not into the issue tracker? @greggirwin @toomasv
13:39@dockimbel in addition to [is questions](https://gitter.im/red/bugs?at=5c40804995e17b452566f180), some react questions:
4) [Here](https://github.com/red/red/blob/5e37a10f19f9a4f27d0fdc34e8c58797a0763824/environment/reactivity.red#L270) and [here](https://github.com/red/red/blob/5e37a10f19f9a4f27d0fdc34e8c58797a0763824/environment/reactivity.red#L322) 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.
5) It looks like 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?
Oldes
15:13@dockimbel Is there any reason why refinement! is not part of any-word! or is it just oversight?
In Rebols:
>> any-word? /ref
== true

In Red it is false.
15:16Also it looks that 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
)

While with issue:
>> make map! [#is 11]
*** Script Error: issue! type is not allowed here
*** Where: make
*** Stack:
9214
19:39Red:
>> [/:a]
== [/: a]

Rebol:
>> [/:a]
== [/ :a]
19:57Worth to note as a difference between the two (@endo64). In the grand scheme of things, however, these "rules of sticky-ness" should be formalized, including cases where ommiting space separators between tokens is acceptable, e.g. a[] or (){} (@meijeru).
endo64
23:05@9214 Added to the diff wiki, not sure if it should be treated as lexer difference. Please correct it if it's incorrect.
https://github.com/red/red/wiki/%5BDOC%5D-Differences-between-Red-and-Rebol#lexer
9214
23:06Thanks.

lepinekong_twitter
13:52do-thru regression between 6.0.3 gui-console-2018-6-18-47628.exe and latest 6.0.3 gui-console-2017-8-3-49893.exe, though it generally works, I don't know why it fails with this url https://codeops.red/get-latest-version.red see screencopy below
https://i.imgur.com/JKS71Qb.png
endo64
19:03@lepinekong_twitter What do you mean by latest 6.0.3 gui console?
Latest version is 0.6.4, I tested it with Red 0.6.4 for Windows built 11-Jan-2019/5:18:27+03:00 commit #5e37a10 and it works.
Sorry imgur.com doesn't work here so couldn't see the screenshot.
lepinekong_twitter
19:07@endo64 this one https://static.red-lang.org/dl/win/red-063.exe
19:09@endo64 I can't use 0.6.4 with some of my programs at the moment, it crashes with 0.6.4 so I need to find why and refactor, that's why I'm using 0.6.3. It is probable it's the same behavior in 0.6.4 I haven't tested yet.
endo64
19:13I tested the URL with red-063.exe, worked for me.
greggirwin
22:50@Oldes Red has 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.
22:51@hiiamboris on wiki vs tickets, it may have been that notes were made when the reactive system was new, not stress tested as you are doing now, and it seemed like the best idea at the time.

hiiamboris
09:36I see... Anyway, I'll remove those snippets from the wiki when I get myself to cover reactivity in more depth, since it's not a reactivity bug but a coding mistake.

hiiamboris
06:11@dockimbel before I forget, I have 2 more general questions to add to :point_up: [January 18, 2019 4:39 PM](https://gitter.im/red/bugs?at=5c41d6ff9bfa375aab1f29e1):
6) what was your rationale at that time, for choosing **async** reactivity model?
7) and that behind fixing the reaction source, not letting it to be changed?
13:44**An announcement, sort of, for all of you contributors.** ☻

Once while I was digging deeper into Red I found out that I'm constantly asking myself, "what does thing do?", "where is it defined?", "how is it supposed to be used?", "what parts depend on it?" and so on... I was constantly searching through the source code for stuff, only to forget what I've found just a minute ago and go search again. And GitHub's search is even more boring and useless.

So I decided to automate this process a little bit for me and wrote [this little program](https://gitlab.com/hiiamboris/red-codex/tree/master). I find it a big help already. I however hope that you too will find it useful. Please let me know if there's anything I can do to make it work for each one of you!
rebolek
13:45:+1:
13:46Your choice of font and colors is ... interesting :smirk:
hiiamboris
13:48(: Thanks.
It should blend to native colors by default, but you can enable the (displayed) vaporwave skin in the script if you install the [ZX Spectrum-7 font](https://www.dafont.com/zx-spectrum-7.font).
toomasv
14:57@hiiamboris It indexed everything, but no interface appeared after that.
hiiamboris
15:08@toomasv did it report some error or just quitted silently?
toomasv
15:08@hiiamboris No error. Just silence.
hiiamboris
15:09Lemme try on W8.1
15:12True. You've just found another crash on W8+ ☺
15:15
*** 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
15:38https://github.com/red/red/issues/3753
@toomasv you can comment [line 287](https://gitlab.com/hiiamboris/red-codex/blob/master/redcodex.red#L287) as a temporary workaround until the bug is fixed
15:42I've found ~20 bugs while I was writing that. Feels like being a sapper ☺
meijeru
15:43@hiiamboris Nice! It looks much more interactive than my _red-concordance_ published [here](https://gist.github.com/meijeru/ce66cfaf6c4ef8add2ab2065541449a1). Also, apparently you work with parse, whereas I did a simple recursive descent. For simple text searches -- not at all interactive -- I use my own version of _grep_ , published [here](https://gist.github.com/meijeru/badcc5184f312aedf51a010b4718a148). I have more or less the same needs as you, but I got by with these two tools until now. I will try to use yours and see if it is more effective.
toomasv
15:45@hiiamboris Thanks! Interface opened, but only left panel works. Right-panel stays empty while clicking on file-names on left.
hiiamboris
15:49@toomasv you right-click on em?
toomasv
15:50Aah. Sorry, right-click works. Thanks!
hiiamboris
15:51Yeah, I may have a little strange UX ideas :)
meijeru
15:57Found an interpreter bug (I think):
foreach f fs pick [
		[index-file f]
		[unless find f "tests/" [index-file f]]
	] config/include-tests?

(%red-codex.red line 176-179) give the following error message:
*** 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.

15:58It has happened before that the toolchain expected a literal block where a "computed block"would have been useful.
hiiamboris
16:00Oh! You can forget about compiling it without -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.
16:04@meijeru With concordance I'm stuck at preparing the lexer...
meijeru
16:06Sorry! Not an interpreter bug obviously, but a compiler one. The interpreter works fine. But has that particular compiler bug been reported already?
hiiamboris
16:08I think not. I think I had a similar issue with loop - I fed it with a dynamic block, and @dockimbel said it's a known limitation not worth the trouble reporting it.
meijeru
16:14What difficulty exactly do you experience with the lexer adaptation? Is [this one](https://gist.github.com/meijeru/202c25f124e075ff5be85dff1beeda15) not good? I ran it just now and it works for me...
hiiamboris
16:18Yes this one works @meijeru ! I like how thorough your analyze func is.
meijeru
16:44@hiiamboris Accepting the limitation of the compiler for the moment, the code explorer should work in interpreter mode, shouldn't it? For me, it shows a console briefly and then quits. W10 64 bits, using commit 5e37a10f1 (one but last).
hiiamboris
16:46@meijeru I can't test on W10 unfortunately. Have you commented the line 287? And do you run it from the directory where red.r is located, with also glob.red being present there?
17:02@meijeru https://gitlab.com/hiiamboris/red-codex/tree/w8tempfix I made changes to both source & binary for W8+, it works on my W8.1 and apparently on @toomasv's W10. By the way, I'm compiling it with my modified reactivity engine (https://github.com/red/red/pull/3748), so the exe should behave a little better than the source in terms of GUI event handling.
toomasv
18:47@hiiamboris @meijeru Yes, it works with W10, although it's somewhat brittle, crashing now and then :). Nevertheless, it is of great help!
hiiamboris
18:54@toomasv Glad you like it. Actually it never crashed on W7. Does it do that often enough to reproduce and isolate the crash?
toomasv
19:07@hiiamboris It sometimes crashes just when I enter the search word after initialization. Sometimes not. If it stays on its feet after entering the search word then it can crash after I right-click, but it has greater chances of survival if I first left-click. Don't have yet clear regularities.
hiiamboris
19:15I've encountered myself two irregular bugs there:
- sometimes focus is just lost from every face, totally
- sometimes a press of Enter inserts a newline into an area created in result of that key press

Couldn't see a pattern yet. But then these are just tiny annoyances. Crash has bigger priority ☺
19:18@toomasv you can add 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
endo64
21:29It looks great, but couldn't make it work :(
First downloaded the executable, it crashed immediately.
Then downloaded the source file, couldn't compile: *** Compilation Error: expected a block for FOREACH-BODY instead of word! value
Then encapped with -e, nothing happened when executed (no output at all)
21:29I'm on Win10 x64.

hiiamboris
07:07You can level up Red's Win10 support then by diagnosing the crashes. I believe in you all! ☺
gltewalt
09:13Only have Win7
meijeru
13:21On the problem of literal body blocks being required for almost all control flow constructs, see [REP 41](https://github.com/red/REP/issues/41). I made this just not to forget the matter.
hiiamboris
13:55:+1:
ericguedespinto
14:04I noticed that ‘allocate’ in R/S works differently in Win7 (it works as malloc) than in macOS (where it works as calloc). This meant an illegal memory access crash in win when it worked fine in macOS. Is this intencional?
hiiamboris
14:14@ericguedespinto calloc isn't even imported by Red runtime. Do you mean MacOS zero-fills the RAM requested by malloc?
14:20I see, you mean the MAP_ANONYMOUS flag in mmap does that...
ericguedespinto
14:25@hiiamboris yes! I used it to check if a given structure field had been allocated or not. It worked on mac but not on win. Solved it by implicitly initialising it to 0.
hiiamboris
14:38@ericguedespinto It seems to me that on Windows it should use VirtualAlloc which also zero-fills the region.
14:38Do you have any snippet that can show the difference between W7 and Mac?
14:44allocate itself is an imported malloc. So if you used it and got zero memory you might just have been lucky that's all ;)
ericguedespinto
15:00@hiiamboris This is the code that I have been playing with. It is an implementation of a graph:
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! r3

On the graph/new-node function I had to add the initializing bit to zero out the structure fields.
I have been playing with this for a week on macOS and so far it has not failed, but in Win it failed straight away.
In any case, it should behave similarly on both systems...
9214
15:05@ericguedespinto can you try to narrow it down to something more minimal?
hiiamboris
15:06He uses allocate 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.
ericguedespinto
15:14I narrowed it down so that it only uses nodes and properties (no relationships).
I am on Win now so I cannot test it under macOS.
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! n1

As it is it gives and *** Runtime error on Win but works fine on macOS.
If you uncomment the 2 lines in graph/new-node, than it works fine on both.
My concern is the dual behavior, not the extra keystrokes to initialize the memory...
hiiamboris
15:20> My concern is the dual behavior, not the extra keystrokes to initialize the memory..

As you can see here https://github.com/red/red/blob/master/system/runtime/libc.reds#L15 allocate is malloc so it wasn't designed to zero-fill the chunk. So it's totally expected for your code to fail ☺
9214
15:20For me this 2 lines are expected, and macOS' (lucky) behavior sounds odd.
ericguedespinto
15:32@hiiamboris I tried allocate-virtual and zerofill and those give me an 'undefined symbol' error.
I cannot find them on the R/S language specification.
How do I use them?
hiiamboris
15:39Yeah, good question. Better to address it to @qtxie or @dockimbel.
ericguedespinto
15:40Thanks
9214
15:42@hiiamboris prove me wrong, but allocate-virtual and zerofill belong to Red memory allocator, not to R/S runtime.
ericguedespinto
15:54I couldn't find any R/S allocate-virtual or zerofill but I found the equivalent in set-memory
as node! set-memory allocate size? node! as byte! 0 size? node!

Not too pretty... but it works
meijeru
15:55allocate-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 (?)
Information obtained through my red-concordance and grep utilities.
hiiamboris
15:58@9214 is totally correct. I'm misleading you @ericguedespinto, these work from Red only. In R/S you should use set-memory (memset) or just import calloc yourself. I think it should be faster than zerofill anyway, as these are written in asm.
ericguedespinto
15:59Thank you all
living and learning...
9214
16:01@meijeru can your tool check if fill 0 is used instead?
hiiamboris
16:09fill is used in hashtable, binary and vector. zerofill is never used.
greggirwin
23:08@hiiamboris I get the access violation from redcodex as well, on Win10. Will try to make time to play with it soon. :+1:

greggirwin
02:53In other news, I made a simple PR for the 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]

@hiiamboris since you've been into reactor code recently, and @dockimbel made a change there a couple weeks ago, does this sound familiar at all? @qtxie doesn't see the error.
02:54BTW, @hiiamboris, thanks for the qt-verbose flag. :^)
hiiamboris
08:17@greggirwin I answered in the PR.
greggirwin
21:50:+1:

Dobeash
11:35Is this a known issue?
>> make map! reduce ['a 1]
== #(
    a: 1
)
rebolek
11:36@Dobeash all word!-based keys are treated as equals in map!
11:37
>> m: make map! reduce ['a 1]
== #(
    a: 1
)
>> select m 'a
== 1
>> select m quote :a
== 1
BeardPower
11:38@Dobeash What did you expect it to be?
Oldes
12:02@BeardPower in 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
]

although still treated like same:
>> m/(quote a)
== 1

>> m/(quote 'a)
== 1

>> m/(quote :a)
== 1
rebolek
12:03Red's version makes more sense IMO.
Oldes
12:06@BeardPower one may expect Ren-C's todays behaviour:
>> m: make map! [a: 1 :a 2]
== make map! [
    a: 1
    :a 2
]

although I'm not sure if it is useful enough
BeardPower
12:07@Oldes I don't see any advantage of having keys like :a, /f or #e.
12:08Having a key like a get-word could make thinks even more troublesome.
Oldes
12:09Me either.
rebolek
12:09Having issue! as key makes sense, not sure why it's not allowed, unlike get-word!
12:10
>> make map! [#a 1]
*** Script Error: issue! type is not allowed here
*** Where: make
*** Stack:  

>> make map! [:a 1]
== #(
    a: 1
)
BeardPower
12:10No, issue! is not allowed.
rebolek
12:10I know, I just don't understand why.
Oldes
12:10/f and #e are of word! type.. don't know, why they are treated differently in Red
BeardPower
12:11@rebolek Where do you see an advantage of having issue! as a key?
nedzadarek
12:11@rebolek My guess is that any-word! is converted to the word!.
Oldes
12:11@BeardPower can you explain me this?
>> all-word? #aa
== true
>> any-word? #aa
== false
rebolek
12:12@BeardPower Saving one conversion. Explain to me, why get-word!is fine and issue! is not.
BeardPower
12:14@Oldes
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
Oldes
12:14@BeardPower having 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).
rebolek
12:15@BeardPower but why...map values are not bound.
BeardPower
12:15@rebolek I'm not the designer of Red ;-)
Oldes
12:16Personally I think, that its just overlook that issue and refinement are not allowed.
rebolek
12:16Yeah, I think too.
BeardPower
12:16@Oldes Is issue! bindable?
12:17If it is, it should be in any-word!.
Oldes
12:17Is string! bindable?
nedzadarek
12:17*** Script Error: bind does not allow issue! for its word argument
BeardPower
12:17@nedzadarek There we have it ;-)
12:17issue! is not bindable so it's not in any-word!.
nedzadarek
12:18But, still, issue as key make sense.
Oldes
12:18@BeardPower do you still remember, that we were talking about map! keys?
>> make map! [#aa 1]
*** Script Error: issue! type is not allowed here
*** Where: make
*** Stack:  

>> make map! ["aa" 1]
== #(
    "aa" 1
)
BeardPower
12:18@rebolek The question is, if it's good design using issue! as a key in the first place.
rebolek
12:19@BeardPower As @Oldes wrote, it may come from dialect for example and in such case you need to do to word! issue before using it as key. But why.
BeardPower
12:19@nedzadarek But bind is only taking any-word and block, so it's obvious that it does not allow issue ;-)
12:20@Oldes Yes, I do. The question is what was the idea about keys?
rebolek
12:20But bindmakes no sense in case of map!
nedzadarek
12:21@BeardPower yes, it's obvious when you read doc :D
BeardPower
12:21@rebolek What is the idea of keys? Having any type? A specific type?
rebolek
12:22@BeardPower certainly no, if it can be any-word.
BeardPower
12:22@nedzadarek What I meant is that bind takes any-type and issue is not part of any-type so it's a chicken-egg issue.
rebolek
12:22Yes, the question is, why it takes any-word and not all-word
nedzadarek
12:23bind takes any-word!/block! not any-type!.
12:24^^ well, maybe we should move to the /help room? It's more suggestion than bug.
BeardPower
12:24@rebolek It's just a design decision. E.g. PHP only allows integer and strings. Optimization? Resource usage? KISS?
12:26Only @dockimbel can answer the idea behind it.
rebolek
12:27I understand. But I agree with @Oldes that it can and should be changed.
BeardPower
12:27Maybe because of REBOL compatibility?
12:27;-- warning: following typeset definitions are processed by the compiler, do not change them
;-- unless you know what you are doing!
12:27Or compiler limitations?
rebolek
12:28I don't want to change typeset, just allow all-word, instead of any-word as key
BeardPower
12:28To do that you need to change the type-set.
12:29any-word and all-word are type-sets.
Oldes
12:29@one can just add 2 words into this block: https://github.com/red/red/blob/master/runtime/datatypes/map.reds#L700-L704
hiiamboris
12:29There are a lot of limitations to current map implementation. I wanted today to use blocks and objects as keys, but it won't allow me. R/S hashtable allows both, but map interface won't accept any of these. I think Doc was undecided on how best to support these types so it was best not to implement their support just yet.
rebolek
12:29I meant that I don't want to change members of any given typeset.
BeardPower
12:30@rebolek Yeah, my bad. You suggested to change the type of the param.
rebolek
BeardPower
12:31The question is, if it would break something.
12:31Hard to tell without knowing about the design decision.
12:33@hiiamboris R/S are only supporting basic types and we are not getting into the realm of red-types.
hiiamboris
12:33@BeardPower I mean R/S basis on which the map! type rests already has the code for both Red objects and Red blocks as keys
12:35Take a look https://github.com/red/red/blob/90c8e83ab8244d752e5a3df1bd41f9f52c342f5b/runtime/hashtable.reds#L224
BeardPower
12:36@hiiamboris Yeah, maybe it's just not implemented yet. It would just need to serialize the additional types:
preprocess-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)]]
		]
]
hiiamboris
12:37Would it? I wanted to use it's current implementation where the contents doesn't matter (hash of an object is it's internal node address, hash of a block is it's head+node)
BeardPower
12:37Yes. it's just a matter of pre-processing and serialization of the key.
12:38@hiiamboris Sure. Code is data is code, right?
hiiamboris
12:39Well, as long as it does not hash the contents, I'm happy.
BeardPower
12:40There is no limitation, as every type is a red-value. You just need to handle the specific red-value correctly.
12:42@hiiamboris Why would it hash the content? If it does, you implemented it to do so ;-)
hiiamboris
12:44I mean it's a solid design question - to hash the address or the contents. Can be pros and cons to both, but no way back ;)
BeardPower
12:48What's the advantage of hashing the content? Content is something you want to "read" and work with. Hashing would lock the content to be not-readable any more.
hiiamboris
12:48You have it for all the strings already.
12:49Hash is buggy btw, vulnerable to brute force:
>> 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
12:49It's safe to assume hash is always buggy in Red :)
BeardPower
12:50>You have it for all the strings already.

What do you mean? The string value being hashed?
hiiamboris
12:51@BeardPower yes indeed: https://github.com/red/red/blob/90c8e83ab8244d752e5a3df1bd41f9f52c342f5b/runtime/hashtable.reds#L237
BeardPower
12:51Ah, you meant the content of the key. I though that you meant the value.
12:51That's hashing the key, not the value.
rebolek
12:51 @hiiamboris what build are you using? I can't reproduce it.
BeardPower
12:52key : value
hiiamboris
12:52@BeardPower So someone may want to hash the contents of the block-key
12:52@rebolek Red 0.6.4 for Windows built 11-Jan-2019/5:18:27+03:00 commit #5e37a10
rebolek
12:53I've got older build, let me check on newer one
BeardPower
12:53@hiiamboris I don't have the problem either.
12:53Red 0.6.4 for Windows built 13-Dec-2018/13:19:16+01:00
hiiamboris
12:54So it's a either recent thing, or Windows thing. No, just recent thing.
BeardPower
12:54@hiiamboris I think that would need to be discussed; Pros/Cons.
rebolek
12:55Pulled latest sources and still no problem.
12:55Tested with
>> probe about
Red 0.6.4 for Linux built 17-Dec-2018/9:23:46+01:00

and
>> probe about
Red 0.6.4 for Linux built 24-Jan-2019/13:53:52+01:00
12:56Actually...
>> probe about
Red 0.6.4 for Linux built 24-Jan-2019/13:53:52+01:00

unset
hiiamboris
12:56Tried repeating that select a lot of times with Up+Enter?
rebolek
12:56@hiiamboris about 20-30 times
12:57Ha, after doing some other stuff in console, I get this:
BeardPower
12:57Red 0.6.4 for Windows built 23-Jan-2019/15:42:51+01:00 commit #eb0d85a

also working.
rebolek
12:57
>> 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
hiiamboris
12:57Yes that's it! It doesn't always appear.
BeardPower
12:58@rebolek What "other" stuff?
hiiamboris
12:58For me it enough to retry the initial h: ... string a few times, wait a few secs, and hope :)
rebolek
12:58 probe about, print "Asdf", ?? about
12:58and h
BeardPower
12:59No issue here.
hiiamboris
12:59I'll report it
rebolek
13:02Hm, triggering it is really non-trivial.
BeardPower
13:02Try it in a loop.
13:02It always reports none for me.
rebolek
13:04
➜  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]
13:05@BeardPower can you try this? ^^
hiiamboris
13:06none is also a bug, right? without /same refinement the result should be 123
BeardPower
13:06@rebolek
>> 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]
rebolek
13:06So reproduced.
BeardPower
rebolek
hiiamboris
13:07:D :D
BeardPower
13:07Try this:
loop 200 [either [select h [] = none][][print "strange"]]
rebolek
13:07that prints nothing
BeardPower
13:07Not a single output of strange ;-)
13:07Because it returned none all the time.
13:08So why is the first loop not returning none all the time but the second?
rebolek
13:08[] = none
13:09I don't know, it's a strange bug :)
BeardPower
13:09It's the same as:
loop 200 [either [(select h []) = none][][print "strange"]]
hiiamboris
13:09Because print is slow.
rebolek
13:11@BeardPower loop 200 [either none = x: select h object [][print x][print "strange"]]
BeardPower
13:11
loop 200 [either (select h []) = none [][print "strange"]]

13:12Very strange.
rebolek
13:12it's not select h [] but select h object []
13:12you have objects, not blocks in h
BeardPower
13:12Oops, my bad ;-)
rebolek
13:13So it looks like you need to print it to trigger the bug
13:14
>> loop 200 [either none = x: select h object [][probe x][print "strange"]]
none
strange
strange
none
none
none
none
strange
strange
(...)
hiiamboris
13:15
>> loop 1000 [if (v: select h object []) [print v]]
234
345
123
345
13:17https://github.com/red/red/issues/3756
BeardPower
13:19This is very weird!
>> 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"]]
>>
13:20
>> loop 1000 [if (v: select h object []) [print v]]
== none
13:20What the heck is going on?
hiiamboris
13:21Add another zero ;)
BeardPower
13:21
>> h
== make hash! [make object! [] 123 make object! [] 234 make object! [] 345]
>> loop 1000 [if (v: select h object []) [print v]]
123
234
== none
>>
13:22Something is fucked up, that's for sure.
13:23@hiiamboris Yeah, loop 10000 produces the "buggy" result :-)
13:24Sometimes it has zero errors.
13:25The number of "buggy" outputs is also very different at each call.
13:25Seems random as well.
13:26Good find @hiiamboris !
13:26I think we need to adapt the tests to catch errors like this.
hiiamboris
13:27It's a GC bug. After recycle/off it fails only once and then it's always none.
rebolek
13:27@hiiamboris :clap:
BeardPower
13:28@hiiamboris I fear not.

>> 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
hiiamboris
13:30
>> 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

(I've got a whole screen of these)
BeardPower
13:30
>> 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
>>
13:31It needs multiply recycle/off calls for me to work.
13:33If only one call, it takes a lot longer to work:
>> 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
>>
13:34Definitely a GC bug @hiiamboris :+1:
hiiamboris
13:35And then I typed:
>> recycle/on
>> loop 10000 [if (v: select h object []) [print v]]

And waited about a *whole minute* for it to output me a few strings. Looks like GC needs some optimization too...
BeardPower
13:39Only 5 secs for me.
13:40But that could be because of CPU/RAM of course.
hiiamboris
13:51Or because I created millions of objects before :)
BeardPower
13:55Probably :-)

gltewalt
05:08It always prints none in CLI console on Win7
05:08GUI console is erratic
hiiamboris
10:35Does anybody else having problems reading ANY page from GitLab in Red?
>> read https://gitlab.com/help
*** Access Error: cannot connect: https://gitlab.com/help reason: timeout
*** Where: read
*** Stack:
dsunanda
10:49 Reading gitlab works fine from where I am:
length? read https://gitlab.com/help
== 70734
hiiamboris
10:51@dsunanda what platform? I'm on W7
dsunanda
10:51Win10
hiiamboris
10:51I see. Thank you.
Phryxe
11:49F-secure have problems with latest red exe (https://github.com/red/red/issues/3757).
hiiamboris
11:55@Phryxe you should report that to F-Secure developers instead
Phryxe
12:05@hiiamboris Have you read the issue? So you mean we should never report this kind of issues here?
rebolek
12:07There's nothing Red team can do about bad heuristics.
hiiamboris
12:07Yes. We can't influence all the A/V vendors out there to not blacklist Red. Only you the end users can do that.
Phryxe
12:08OK, I'll never report these again :tongue:
hiiamboris
12:22@Phryxe BTW I also believe that *bad heuristics* is intentional in most cases, both to get a cut from the better financed project leaders and to make an appearance of the safest A/V out there.
rebolek
12:24Hm, so there's an opportunity to make some money with the safest AV software using print "Warning: Virus detected" :smirk:
hiiamboris
12:26Sure, as long as you are trusted ;)
amreus
12:47I no longer get any virus warnings on Windows. I do not know exactly why, but here is what I did: Prior to the release of version 0.6.4 I had turned off "Cloud-delivered protection" in Windows Defender. I had the Cloud option off for about 1 month. That alone stopped the warnings and quarantines for the 0.6.3 releases. When 0.6.4 was released but before I downloaded it, I turned the Cloud option back on. Defender has been silent ever since. I install the most recent updates as they become available and nothing from Defender.
13:04to-local-file/full crashes the gui console for me.
13:05[![00563.png](https://files.gitter.im/red/bugs/rcQk/thumb/00563.png)](https://files.gitter.im/red/bugs/rcQk/00563.png)
13:06
>> about
Red 0.6.4 for Windows built 24-Jan-2019/22:49:24-05:00 commit #702ec38


hiiamboris
13:27can't reproduce on W7 built Jan 11
13:56@toomasv @meijeru @endo64 @greggirwin I've updated the code explorer in accord with all your feedback so far. Thanks again for taking the time to test it! More user-friendly now, single branch for everyone, and you have a precompiled version with GC disabled as I've seen it cause a lot of crashes. https://gitlab.com/hiiamboris/red-codex/tree/master
endo64
15:21@hiiamboris Thanks! I'll update and test the latest version in a few hours.
15:22> Does anybody else having problems reading ANY page from GitLab in Red?

It works for me (Win10 x64)
toomasv
15:54@hiiamboris Thanks! It's a major help and works like a charm! A little misalignement with font:

[![image.png](https://files.gitter.im/red/bugs/0vXw/thumb/image.png)](https://files.gitter.im/red/bugs/0vXw/image.png)
hiiamboris
16:02@toomasv It's intentional ;) Otherwise you wouldn't see it at all...
toomasv

greggirwin
01:14I can also read from gitlab fine on Win10 @hiiamboris.
01:18to-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!.
01:19Will check out the new code explorer when I get a chance.
meijeru
13:25@hiiamboris I have tried your latest code-explorer and it works fine. I had long wanted to make a similar one of my own (after my experience with the concordance), also to try out some GUI features. So I went ahead, inspired by your efforts and those of @toomasv, but not based on your source. The result is [here](https://gist.github.com/meijeru/2665add5f9e72378c7ffdb3fda3adddf): "word-finder".
hiiamboris
13:47@meijeru :+1: a big step ahead from concordance in my opinion ☺
meijeru
15:27I have now also compiled it, but for that I had to take the function store out of the function analyze since the compiler -- unlike the interpreter -- cannot cope with nested functions. I will now update the gist.
toomasv
16:39@meijeru Great!
endo64
23:10Is this a known bug?
>> view [text "one^/two^/three" 200 red]
>> view [text "one^/two^/three" 200 red white]

Textbox auto expands vertically in the first example, but it doesn't in the second one. (at least on Win10 x64 - Red 0.6.4 for Windows built 11-Jan-2019/5:18:27+03:00 commit #5e37a10)

toomasv
07:03@endo64 May be connected to #3336. It seems that size is miscalculated for changed font in [system/view/platform/size-text](https://github.com/red/red/blob/master/modules/view/backends/platform.red#L541)
hiiamboris
09:00I don't think it was reported before, @endo64 . Confirmed on W7.
meijeru
09:40@toomasv I am now trying your syntax-highlighter. One small remark: the resizing does not react to the "full screen" button, in the sense that the canvas remains the size it had, inside the full-screen window.
09:40I am on W10 4 bits.
endo64
09:48@meijeru It is the reason that your windows is 4 bits :) (sorry couldn't resist)
meijeru
10:084 -> 64 (I should watch what I type :smirk: )
toomasv
11:05@meijeru Yes, not done yet. Thanks!
endo64
21:11> I don't think it was reported before, @endo64 . Confirmed on W7.

Could be related to these issues: #3336 , #2503 , #2757
I raised a new issue any way, if you think it is duplicate, I can close it.
hiiamboris
21:18@endo64 It must be something to do with face not being fully ready at the time of size-text call (no state facet yet). This function's logic is a labyrinth right now ☺
endo64
22:23Should block values also raise invalid function definition error when used in function spec.

I see that TYPE_BLOCK is accepted in spec checking function (validate), see this line:
https://github.com/red/red/blob/e7c460382877e749bf7120f8ed77158cec3e4c9c/runtime/datatypes/function.reds#L795

>> 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]

gltewalt
22:58Not exactly because it is block values that hold the types. function [x y [string!]]
22:59If there’s a block value that doesn’t contain daratype words, then error?
23:06func [[string!]][] is allowed

toomasv
13:20@meijeru Full-screen done, some navigation quirks corrected.
gltewalt
19:59
>> 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

20:00Red 0.6.4 for Windows built 27-Jan-2019/3:20:41-07:00 commit #e7c4603
20:02// accepts vector
20:06mod accepts vector, but uses absolute in it's body
hiiamboris
20:22mod 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/2433
vector 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?
gltewalt
20:238 8 8 ?
hiiamboris
20:23nope...
gltewalt
20:26and it modifies the vector(s)
Oldes
20:27For me it is required that vector is modified.
20:27and this should be error and not what it is:
>> 1 - make vector! [16 16 16]
== make vector! [15 15 15]
gltewalt
20:29Once made, they aren't modified by + - * / %
Oldes
gltewalt
20:30A new vector with the result is returned
hiiamboris
20:31@Oldes An obvious solution is to make a 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.
gltewalt
20:32
>>  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]
20:32Modified in place
Oldes
20:34Yes... and I'm fine with it... except, that 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.
gltewalt
20:34modified in place with v - 1, but not with v * v. That will probably confuse folks
hiiamboris
20:35@Oldes don't you also want a - b to be done in place (modifying a)? or a way to fill the vector with a given constant value?
Oldes
20:36On the other side, I can imagine matrix! or other vector type variant, which will copy itself before modifying.
gltewalt
20:36That makes sense
Oldes
20:41True is, that if 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.
20:46One should bring real life examples... I don't think that using math like 1 - v * v - 1 makes any sense.
20:48And it is nice to write:
>> v * 10
== make vector! [40 40 40]

instead of:
>> forall v [v/1: v/1 * 10] v
== make vector! [40 40 40]
20:49One can always use 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]
hiiamboris
21:121 - 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.
21:13Are there any objections against DSL approach though?
meijeru
21:15Issue #2216 is relevant to this discussion.
rebolek
21:55*... fast functions like sin or log...*

well...
hiiamboris
22:04:D compared to one token processing of Red I mean

gltewalt
00:20Sort of cross posting, but since behavior was being discussed, comments are welcome:
https://github.com/red/docs/pull/125
greggirwin
08:37@meijeru, fantastic work! We need to start a tools page.
08:42Since I knew that vectors modified in place, I successfully predicted the result from @hiiamboris's example. That's not an endorsement of the current behavior, just that it can make sense to at least one person, given that they know the ground rules.
Oldes
10:01@greggirwin I would really like to hear explanation for this:
>> 1 - make vector! [16 16 16]
== make vector! [15 15 15]
10:04It is like saying, that 1 - 16 == 15
meijeru
13:22That definitely looks like a bug!
greggirwin
20:48@Oldes, Ah! I got the answer, but misinterpreted the intermediate result. I thought it would be [-4 -4 -4], from Boris's example, which still gives the same end result.

Yes, that's just a bad result.
Oldes
20:50The question is, if it should be supported.. I would prefer error in this case.
greggirwin
20:52Agreed.
toomasv
20:56@greggirwin Did you also guess correctly the final value of v not only the expression?
greggirwin
20:58No, I got that one wrong too!
toomasv
21:01I was quite confused, but now I understand (/guess) only first op modyfies v, multiplication by another vector produces new vector, and subtracting from the new one doesn't modify 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]

Oldes
15:38Is it ok, that it is possible to unset a word using set with block?
>> b: 1 set [A B] reduce [4 ()]
== [4 unset]
>> b
*** Script Error: b has no value
*** Where: catch
*** Stack:

While it is not possible when using with word directly?
>> b: 1 set 'b ()
*** Script Error: b needs a value
*** Where: set
*** Stack:  

>> b
== 1
15:40What if it would just ignore setting the value b in the first case (without throwing an error)?
15:41Although that could be if set/some is used.
nedzadarek
15:45@Oldes Yes, there is /any refinement that should set unset values.
Oldes
15:45Ok... so it is a bug... as it should unset b only with /any, right?
nedzadarek
15:46@Oldes I think so.
Oldes
15:56https://github.com/red/red/issues/3766
greggirwin
22:12On vectors, consistency, so we can reason about behavior, seems like a key criteria.
22:18Set/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.

Good ticket @Oldes.
gltewalt

endo64
15:27
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

Positive numbers (float! & integer!) are treated as true in R3 (in R2 the result for integer is strange [2 3 4 5 6 1])

R2 doesn't accept return values other than integer! and logic! for the compare function.
R3 accepts all return values and treats them all (word!, money!, tuple!, issue) as true (only negative numbers are treated as false, with an exception of money! which is always treated as true even for $-12 or -$12)
Red also accepts all return values, but positive numbers are false, negative numbers are true, which is strange.
hiiamboris
15:35@endo64 Yes, weird...
Red & R2:
>> sort/all/compare [1 4 6 3 2 5] func [a b] [a - b]
== [1 2 3 4 5 6]

R3:
>> sort/all/compare [1 4 6 3 2 5] func [a b] [a - b]
== [6 5 4 3 2 1]
15:38I'd say R3 is the only one who has got it right.
endo64
15:38I think so too, raising an issue.
hiiamboris
15:39a > b <=> a - b > 0 <=> a - b
endo64
15:40No need /all tough, sort/compare [1 2 3 4 5 6] func [a b] [5] is enough to show the issue.
hiiamboris
15:41Yes, /all only matters with /skip
endo64
15:48#3768
hiiamboris
16:00@endo64 there's smth with the wording of your issue though
endo64
20:08Feel free to change it if you can, or send me the correct wording so I can change it.
20:11@hiiamboris Ah I saw it now and fixed, thanks!
hiiamboris
20:13☻ :+1:

TheHowdy_gitlab
22:10Today I came across [this StackOverflow](https://stackoverflow.com/questions/50883367/red-language-changing-button-image-doesnt-work) question, and it seems like that person just discovered a bug: in the stable & nightly versions, neither does this code change the displayed image
view [button "Text" %head.png [face/image: %tail.png]]


nor does this code remove the displayed image

view [button "Text" %head.png [face/image: none]]

Note that the face's image property does change, as seen by adding probe face/image, but it doesn't display it. Also had no luck with defered updating.
22:12Just realised u have to load the image first... but that doesn't work either:
view [button "Text" %head.png [face/image: load/as %tail.png 'png]]
nedzadarek
22:19@TheHowdy_gitlab Works with base instead of button. I think I have seen this.

TheHowdy_gitlab
11:49But it should work with button too, right? If so, shall I open an issue?
hiiamboris
13:17@TheHowdy_gitlab yes
endo64
15:17Still it's known issue and image support added to button recently and still it not complete, as it requires custom drawn button (on Windows at least) as normal buttons doesn't support images as background.

gltewalt
07:11Access Violation after compiling with console functions and then running the .exe

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-consoles
07:12
C:\Users\Old Man>rbu

*** Runtime Error 1: access violation
*** at: 0041F72Ch

gltewalt
21:38Sorry for the clutter.

9214
17:24@hiiamboris WRT your recent (and excessive) comments on closed tickets. All crashes follow the similar pattern, and end up with object/rs-select. I suspect that it has something to do with hashtable, as it's used for symbol searching in contexts.

Could be [this](https://github.com/red/red/commit/4f4f328731367dfb13dbc6b6c57fee125184e1b3#diff-0459b171dadd9590aea44d8311edbd58R1015)? Happened earlier than 7 Dec though.
hiiamboris
17:29@9214 Can't tell yet. Needs testing with that specific commit and before it.
17:29gimme half an hour ;)
9214
17:30The clock is ticking!
hiiamboris
17:42@9214 no that's not it. That commit works OK.
17:43Look between 6 dec and 18 dec commits.
9214
17:44Try to sprinkle 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.
hiiamboris
18:14@9214 pinpointed it: https://github.com/red/red/commit/4414d6473cfea80aecf32c6b8aa5ee99b161715d
9214
18:17@hiiamboris nice job. So my guess about hashtable was totally baseless.

greggirwin
17:29I was wondering what all the ticket comments were (that I need to catch up on ;^).

viayuve
22:51issue - red console stops working after some time and it does interrupt - restart and shutdown sequence because of "not responding" situation "force quit" does not work either. On mac only solution is to shut it down using power button. Also kill <pid> in terminal does not work. On windows whole thing works with all the triggers on mac it does not.
22:52
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
22:52event log
9214
22:58How much time does it take for the console to hang? Does it happen if the console is idle? Have you tried to turn GC off (recycle/off)?

rebolek
06:23I've encountered this problem on macOS earlier, it was well before GC, so it's caused by something else. You don't have to do anything - just leave the console open and after some time (tens of minutes at least, IIRC) it hangs. But I believe I was able to kill it somehow.
9214
06:38@rebolek thanks. My session usually runs in the background for days, and I haven't encountered this issue (W10). Worth a ticket if others can reproduce it (@x8x?).
rebolek
06:38I haven't seen this issue on Win nor Linux, it's macOS only AFAIK.
9214
06:39Does it happen with GUI console only?
rebolek
06:40It happened with CLI console.
toomasv
06:56It happened earlier on W10 too, not any more.
9214
07:01@toomasv that was a memory leak in the new console engine, been fixed since a while.
gltewalt
07:46kill -9 should blow up any process. Kill by itself only sends an interrupt IIRC. -9 sends kill.

But... that doesn’t fix the problem.
9214
08:03Might be a buggy library call.
x8x
09:56@9214 "console hang" don't remember having that issue, not seen in a long time.
9214
09:57@x8x can you check the latest release on your Mac?
rebolek
09:57It's hard to reproduce, there are no exact steps. It just sometimes happens.
9214
10:12Shouldn't be terribly hard to run idle console in the background.
PeterWAWood
10:25I thought that there was already an issue about GUI console stability on macOS but I can't locate it.
x8x
10:38@9214 Started a fresh CLI console, let see what happen :smiling_imp:
rebolek
11:11@9214 I'm not sure if it does not require some activity. It's really hard to reproduce.
PeterWAWood
11:47until [print now wait 300 false] seems to cause the macOS GUI console to lock up.
rebolek
11:48@PeterWAWood I'll try to test it in the evening
PeterWAWood
11:48Though I am able to Force Quit the instance
12:03@rebolek This also seems to lock the GUI console - repeat i 200 [ print i wait i ]
rebolek
12:03@PeterWAWood and no problem in CLI console?
PeterWAWood
13:50 @rebolek No problem in CLI console.
hiiamboris
14:23but wait 300 is 5 minutes of wait! in a single threaded application that's the very definition of lock up
rebolek
14:24the problem probably is that it doesn't return to console after 5 minutes
hiiamboris
14:29not that anyone will know unless there will be a do-events/no-wait call inbetween
rebolek
14:30Ah, you're probably right.
moliad
14:33I've stopped using the gui console on windows. too many interference with view code. I just added 'view as a needs for the shell console and can now run view apps from dos prompt. it works very well.
rebolek
14:35anyway, the mac problem was present in CLI console too, so it's not GUI-console related
hiiamboris
14:38@moliad yeah, everyone's using it this way :)

Oldes
10:29@dockimbel Not actually bug, but I noticed, that bitset! 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
== true
9214
12:49@Oldes yes.
Oldes
12:50Reason?
9214
12:55@Oldes the same as in Rebol I believe.
12:55> Unlike other series datatypes, bitsets are zero-based. This allows the NULL character to be included in the bitset and tested.
x8x
13:30@9214 CLI console idle and no issues. I had problems months ago with the event loop on macOS CLI console when running/stopping View code but Qingtian fixed those.
9214
13:38@x8x thanks!

hiiamboris
18:49Can anybody tell me what kinds of curves are these:
![](https://i.gyazo.com/133db64e38a483832984dfe6ddc7ea7c.png)
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 [(ctype) 5x5 20x5 20x20 5x20]
			]
		]
	]
]
18:50Or rather, is it me nuts or Draw?
toomasv
19:37You :smile:
19:41
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]
            ]
        ]
    ]
]
19:46[![image.png](https://files.gitter.im/red/bugs/EObF/thumb/image.png)](https://files.gitter.im/red/bugs/EObF/image.png)
hiiamboris
19:51@toomasv :D
OK so, contrary to line they always start from 0x0 it seems
Shouldn't they be all symmetric though? And how come they have straight & acute (unsmoothed) angles (4th, qcurv, is the killer really)? Or what role does the point 5x20 play in curv and qcurve?
toomasv
20:01@hiiamboris Yeah, seems to have regressed.
hiiamboris
20:13Interesting that R2 gives the same output, with the exception of curv and qcurv missing (unsupported probably, can't even find the docs for R2 shape dialect)
greggirwin
20:30@hiiamboris http://www.rebol.com/docs/draw-ref.html
20:31There is a "SHAPE commands" section in there.
hiiamboris
20:44@greggirwin Is it R2 doc though? I can't make heads or tails of how to properly use these 4 curves in R2.
21:25figured:
![](https://i.gyazo.com/d857254fdb53e11821a4385f37df35d9.png)

ne1uno
02:22\tests\shape-test.red
02:24you have to use qcurve before qcurv or some other shape?
toomasv
04:14Recalled:
view [box 650x250 draw [translate 10x100 shape [curve 100x100 200x100 300x0 curv 500x-100 600x0 move 0x0]]]
04:14[![image.png](https://files.gitter.im/red/bugs/RqsF/thumb/image.png)](https://files.gitter.im/red/bugs/RqsF/image.png)
04:16
view [box 650x250 draw [translate 10x100 shape [qcurve 100x100 200x0 qcurv 400x0 move 0x0]]]
04:16[![image.png](https://files.gitter.im/red/bugs/rGbL/thumb/image.png)](https://files.gitter.im/red/bugs/rGbL/image.png)
04:30Old examples still working:
[Quadratic](https://gist.github.com/toomasv/6176114cf830390bc46bca29ba2b029f)
[![quadratic-bezier](https://toomasv.red/images/Animations/quadratic-bezier.gif)](https://toomasv.red/images/Animations/quadratic-bezier.gif)

[Cubic](https://gist.github.com/toomasv/8d297d6b65613c181be41fcf693e3655)
[![cubic-bezier](https://toomasv.red/images/Animations/cubic-bezier1.gif)](https://toomasv.red/images/Animations/cubic-bezier1.gif)

rebolek
07:44I’ve just compiled gui-console on Mac from latest sources and it crashes. Can anyone confirm this?
rcqls
07:45I never managed to have gui-console on Mac working. I’ll give a try...
07:52@rebolek It works for me compiled in release mode with the latest red?
07:57Note that I am still on mac Sierra 10.12.6
rebolek
08:54@rcqls thanks. Then you are on cutting edge, I’m still on 10.11.6 :)
08:55Here’s log https://pastebin.com/rdKBczf7
08:58But usually I get just access violation.
09:02Hm, but my automated build works. Good thing I made that service :smile:
09:02It’s throwing some strange error on start, but otherwise it’s fine:
*** Access Error: cannot open: %-psn_0_430185
*** Where: read
*** Stack: 
--== Red 0.6.4 ==-- 
Type HELP for starting information.
rcqls
09:04Weird indeed!
rebolek
09:05@rcqls can you please check the automated build for that error message?
rcqls
09:10Confirmed
*** Access Error: cannot open: %-psn_0_2032112
*** Where: read
*** Stack: 
--== Red 0.6.4 ==-- 
Type HELP for starting information.
rebolek
09:11Hm, you have different number there.
09:11I’ve tried macos-gui-190222.app.tar.gz
rcqls
09:12me too! What is psn?
rebolek
09:13I have no idea.
rcqls
09:14some temporary file built when creation of red binary. The filename is weird, it is incomplete ?
rebolek
09:16On second run I get no error.
rcqls
09:17Confirmed!
rebolek
09:18What I don’t understand is why we have different name.
endo64
23:06A temporary file or folder? Just wild guessing..

gltewalt
00:06psn is a process serial number that macOS assigns
00:06I think it assigns one when an app is open by GUI
rcqls
15:32Is it on purpose? In a slightly modified example of rich-text from the doc, the size of the rtd-layout is fixed to 150x150 and does not fit with the size of the rich-text:
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
    ]
]
15:33[![Capture d’écran 2019-02-24 à 16.33.01.png](https://files.gitter.im/red/bugs/rPbg/thumb/Capture-d_ecran-2019-02-24-a-16.33.01.png)](https://files.gitter.im/red/bugs/rPbg/Capture-d_ecran-2019-02-24-a-16.33.01.png)
toomasv
16:37@rcqls 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
    ]
]
16:39[![image.png](https://files.gitter.im/red/bugs/sfdB/thumb/image.png)](https://files.gitter.im/red/bugs/sfdB/image.png)
rcqls
16:42@toomasv Thanks for the fix. But It is weird that rtd-layout does not offer the possibility to directly fix the size instead of use the prefixed size 150x150 which is completely arbitrary. I mean it is not in the red spirit… BTW, I spent a lot of time tdealing with this kind of example where rtd is used before the visualization of the rich text widget. The layout manager in gtk exists properly only when the rich-text is drawn.
toomasv
16:47@rcqls Where there is a need there is a way (sometimes :smile: ):
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
    ]
]
rcqls
16:49@toomasv You are a champion of the red language!
toomasv
16:49 :relaxed:
rcqls
18:04Better and better! [![Capture d’écran 2019-02-24 à 19.02.59.png](https://files.gitter.im/red/bugs/v2WT/thumb/Capture-d_ecran-2019-02-24-a-19.02.59.png)](https://files.gitter.im/red/bugs/v2WT/Capture-d_ecran-2019-02-24-a-19.02.59.png)
toomasv
18:09 :relieved:

endo64
22:29Shouldn't s be " 2"?
>> s: "1 2"
>> load/next/trap s 's
>> s
== [[1] " 2" none]
hiiamboris
23:07I find these 4 results unexpected. What do you guys think?
>> 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
23:14@endo64 I think you're right there
greggirwin
23:42@endo64 looks like we need clarifications on the designed interaction of /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.
hiiamboris
23:425th:
>> type? load mold none
== word!
greggirwin
23:44@hiiamboris loading "none" *should* result in a word.
hiiamboris
23:44indeed, but should saving/molding none not result in "#[none]"?
greggirwin
23:45That's what mold/all is for.
hiiamboris
23:46what's even the point of saving something that won't be loaded properly anyway?
greggirwin
23:46Forming and molding are design gray areas for some types, to be sure.
23:47That's exactly what /all is for. We have both save and write as well. Mold doesn't know how you're going to use its result.
23:48I think the save suffix? issue is a known one.
hiiamboris
23:48I see. So there's a certain asymmetry in meaning of /all for load and for save/mold.
greggirwin
23:49Yes. No perfect solutions there.
hiiamboris
23:50What about the other two:
>> save %tmpfil [1]  load %tmpfil
== 1    ; in R2 = [1]

>> save s: "" 'junk
== "#{6A756E6B}"     ; why on earth a binary is put into a string??
greggirwin
23:58Loading single values in R2 was a source of some pain, so Red added the common shortcut, which is also not a perfect solution, depending on how you use it. It's intentional though. @dockimbel will have to give his use case reasoning.

The binary issue may be unintentional. 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.

hiiamboris
00:13save could've had an /only refinement for symmetry with mold/only
Otherwise I see no reliable way to balance save with load:
>> 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
toomasv
08:16@endo64 /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"...

To use /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...

rcqls
11:03@dockimbel @qtxie I am trying to use 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.
11:15BTW, editor.red of @toomasv does not work (for me) at all on macOS… Weird!
hiiamboris
11:58@rcqls FYI *on Windows* all these functions are only valid for rich-text currently. For area and other widgets they will give improper results most of the time.
rcqls
12:15@hiiamboris I know these functions are supposed to be only valid for richtext and it was the purpose of my comment. So maybe @toomasv you should not use this function on your editor.red since there is no rich-text widget. Thanks @hiiamboris!
12:53@hiiamboris I understand why this is working in the example of @toomasv. In fact this function works properly because a (richtext) layout is recreated in order to have the proper info. @toomasv is so clever to notice that. So it is an indirect way to get the cursor position of an area since I don’t think there is a direct way to get it for an area widget. But I think it should be offered the functionnality to get directly the current index for area directly. BTW, 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.
hiiamboris
13:23@rcqls let me show you how it really works for area on editor.red example:
![](https://i.gyazo.com/075bff612d18a78abf292a11c270f287.gif)
13:25Although the final hangup was probably not due to the caret-to-offset code...
rcqls
13:43@hiiamboris I guess it is your code? The editor.red of @toomasv is to execute block code inside area. Is there somewhere I can download to try it? Nice butterfly for the pointer. I was considering cursor on GTK yesterday.
13:45Oups by growing the side of the image I see that @toomasv is the author???
toomasv
14:18It works on W10 as long as you don't scroll the text. Have to reconsider this.
hiiamboris
14:29@rcqls no it's https://github.com/toomasv/editor/blob/master/editor.red
14:30it there another editor.red?
rcqls
14:32@hiiamboris That’s the one @toomasv challenges me to make it working on linux… But your beautiful background let me believe it was a different one.
hiiamboris
14:32Oh I see ☻
14:33I agree that caret/offset funcs should be implemented for other (native) controls if (hopefully) the OS supports it. But we're not there yet, not even for Windows backend
rcqls
14:36This is not too difficult… As I said get-text-size is redirected in platform.red depending on richtext or not. So it is possible to provide it for the other text-box-metrics tools in the same way. I could actually propose the PR but I am really busy and above all I am not a red designer.
greggirwin
19:20@toomasv, would you please add your above notes on load/next/trap to https://github.com/red/red/wiki/%5BDOC%5D-Guru-Meditations ? Thanks.
19:22@hiiamboris the first step in proposing changes for 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.
19:23And if we decide not to change things, then we at least have the current behavior clearly documented, to guide people in their use.
hiiamboris
19:33red/REP?
toomasv
19:46@greggirwin [Done](https://github.com/red/red/wiki/%5BDOC%5D-Guru-Meditations#using-load-with-next-and-trap)
greggirwin
19:57@toomasv :+1:

@hiiamboris, yes, I think so.

hiiamboris
00:09@greggirwin https://github.com/red/REP/issues/44
greggirwin
21:17:+1:

bitbegin
02:01
Red []

a: func t: [x y][print x + y]
b: func t [print x + y]

a 1 2
b 3 4
02:02the compiled result is nothing printed, but the console result is "3 7".
02:02Is it a bug for compiler?
PeterWAWood
05:13@bitbegin I don't think this is a bug. After evaluating an expression, the console displays the last value in the console. The compiler does not.
bitbegin
07:14how to explain why the compiler's result is empty
PeterWAWood
08:08The compilers result is not empty, it has been discarded by the programmer.

Red evaluates the expressiona 1 2 to 3. The console takes that value and displays it in the console. The program ignores the result of the evaluation.
08:08Try this in the console:
Red []

a: func t: [x y][print x + y]
b: func t [print x + y]

do [
    a 1 2
    b 3 4
    ""
]
bitbegin
08:11the function a/b's body have print
08:11do you noticed?
PeterWAWood
08:12Sorry I didn't.
10:39@bitbegin Yes, it does look like a bug though I'm not sure if the compiler is able to handle such code yet. @greggirwin or @Qxtie should know.
9214
10:46It's a compiler limitation, from what I recall.
xqlab
12:43Since when does the specification of a function no longer allow a comment after **return:** ?
>> f: func [return: [integer!] "descr" ]  []
*** Script Error: invalid function definition: return:
*** Where: func
*** Stack: f


9214
12:50[Since a while](https://github.com/red/REP/issues/24#issuecomment-421125411).
xqlab
12:55Will it be possible again?
9214
13:01As soon as function's spec design is settled.
https://github.com/red/red/issues/3595
hiiamboris
13:08A little remark: it is still supported by the compiler.
greggirwin
21:08Printing from the compiler may not have been addressed yet, as Full I/O is in progress, and may affect STDOUT, etc.

Oldes
20:02@qtxie maybe it's just a detail, but [you are closing theme](https://github.com/red/red/blob/202bfb031a4e7f2ffe8c25d7f1e273f06c825144/modules/view/backends/windows/gui.reds#L692) only when [GetThemeSysCall](https://github.com/red/red/blob/202bfb031a4e7f2ffe8c25d7f1e273f06c825144/modules/view/backends/windows/gui.reds#L666) was without error. It would be safer to put the line out of [this block](https://github.com/red/red/blob/202bfb031a4e7f2ffe8c25d7f1e273f06c825144/modules/view/backends/windows/gui.reds#L674-L693)

ne1uno
20:27something change for reactor code? *** Script Error: add-relation does not allow object! for its targets argument
20:28I lifted some timer code from retris.red
hiiamboris
20:53Blame me @ne1uno. An oversight.
20:57https://github.com/red/red/pull/3798
greggirwin
21:10Merged. We should add a test for that.
21:10Thanks for the quick response @hiiamboris.

ralfwenske
00:03Following code seems to work on W7. Crashes on Mac. Image size seems to not matter, even though memory gets eaten up according to image size.
Red [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
  ]
]

results in:
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
00:10However, as suggested by @9214 I inserted recycle/off: app does not crash anymore (at least until available memory is exhausted).
hiiamboris
00:26@ralfwenske we have an issue tracker ☻ https://github.com/red/red/issues/new/choose
You may also save Qingtian some work by reducing this snippet to a single empty image I believe.
ralfwenske
04:19@hiiamboris #3801
hiiamboris
11:02@ralfwenske :+1: nice job
qtxie
14:59@Oldes Yes. You're right.
hiiamboris
19:48I'm not sure what to make of this:
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

Outputs me:
i changed 1 > 2
O/I is an integer! value: 4

I think it's a serious bug, but I'm open to opinions
9214
20:11@hiiamboris seems like a limitation of ownership model to me. Reaction is triggered only with set-path! usage.
20:12Worth to note it in a ticket or some wiki page, as object ownership implementation is not finalized yet.
hiiamboris
20:14@9214 ok thanks

PeterWAWood
05:55Re: #3209
Changing line 194 of parse.reds from
if any [type = TYPE_LIT_WORD type = TYPE_LIT_PATH][
to
if type = TYPE_LIT_PATH [
will fix the immediate problem. As I don't know the code, it is hard to say whether this would introduce issues elsewhere.
06:09These two tests fail when the line 194 of parse.reds is changed:
--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

amreus
08:13I am trying to use 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:  

>>

I have tracked the "bad" character in the file to the dot in this string: one · two

I can read the file as binary, but then using to-string also gives the same error.

Is this a bug? Is there a work-around? Thanks.
9214
09:58@amreus "bad" character is 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
hiiamboris
10:16looks like he's reading an iso8859-1-encoded file
amreus
20:03Ah saving the file as UTF-8 worked. I've run into encoding issues before although not in Red. It all seems like a problem that should have been solved already. Thanks for the help.

9214
21:10Can any :penguin: people here reproduce https://github.com/red/red/issues/3811 ?

BeardPower
11:27I experience a crash with RTD:

>> 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 ]
--------------------------------------------
>>
11:29I noticed also that
ahead
says 193. Why is that? It's at the most recent commit.
11:30> Can any :penguin: people here reproduce https://github.com/red/red/issues/3811 ?

No. I had the most recent console version open for 8h straight without any crash.
rebolek
12:00I haven’ seen such problem yet too.
toomasv
12:48@BeardPower Correct way is
view compose/deep [rich-text 100x100 draw [text 10x10 (rtd-layout ["hello"])]]

But crash should be an issue, no?
9214
12:53@BeardPower https://github.com/red/red/issues/3459 ?
endo64
13:57Should we reopen that ticket with a comment? qtxie's last comment is It will throw an error now.
toomasv
14:13@endo64 It was different... image! creation with draw .
BeardPower
14:47 @toomasv The doc says that text can take a rich-text object or just text.
14:48@9214 Does not crash but results in an error:
>> (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
14:51
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
14:52According to the doc my example should be valid.
14:53a string OR a rich-text face.
toomasv
15:00@BeardPower Ah, you are right.
17:22@BeardPower Is [here](https://github.com/red/red/blob/master/modules/view/backends/windows/draw-d2d.reds#L256) the reason? If so, doc is ahead the time.
BeardPower
19:24@toomasv I did not look into the source and what the rtd draw extension is calling.

dockimbel
13:16@BeardPower It is meant to be a feature, if the Draw dialect is missing support for it, you can send a PR to allow it.
hiiamboris
14:45Can somebody try to run this snippet on Windows please https://gitlab.com/snippets/1836128
It's one of the most reproducible heisenbugs I encounter almost every day. This one at least is unaffected by comments.
I can reproduce it only with (the default, set up by red.exe) CLI console: 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.
In 80% runs or so, I get an error (this is what I'm trying to hunt here):
*** Script Error: PARSE - matching by datatype not supported for any-string! input
*** Where: parse                                                                  
*** Stack: view show show do-safe react

Removing some unused code or changing the number of items in d and d2 lists makes the bug go away.
15:03I've run it 200 times for d2 lengths 1..200 and my results so far are:
- parse error on lengths 71, 100, 108 (hello, magic number)
- crash on 110 items
After that it goes steady again
rcqls
15:19VSCode extension 0.3.0 update makes syntax highlighting for red/system not working. Is it the same for other people? I fortunately was able to install extension 0.2.2 which works as before. I can’t live without red/system highlighting….
toomasv
15:21@hiiamboris I run it few times without error with 14march build (W10). When wheeling, I get error *** Script Error: cannot access wheel-outside? in path fa/wheel-outside?.
hiiamboris
15:25Ok. So the OS-specific code affects it a lot too. Thanks @toomasv
rcqls
15:26VSCode seems to install automatically the updated extension 0.3.0 (at least on macOS) …. and things go wrong for me for syntax highlighting for red/system again….
toomasv
16:20@hiiamboris :+1:
BeardPower
16:53@dockimbel Will do.

bitbegin
03:19@rcqls update a minor version to support red/system syntax highlighting
rcqls
05:57@bitbegin Excellent! It’s a bit weird that syntax file for red/system needs to be created since source.redsscope seems to be the same then source.red scope. Thanks for your fix, it works perfectly…

ralfwenske
10:08Is this a bug (in style width works, height doesn’t)?
![alt](https://ralfwenske.net/Screen%20Shot%202019-03-19%20at%207.32.52%20pm.png)
Red 0.6.4 for macOS built 19-Mar-2019/2:56:13+10:00 commit #bec4e2e
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"
]
rebolek
10:31This looks like a bug to me
ralfwenske
11:30Thanks @rebolek will file tomorrow
rebolek
12:29@ralfwenske btw, I can't reproduce it on Linux. Can someone try it on Windows?
rcqls
12:32@rebolek I was about to joke about that on linux/GTK…
rebolek
hiiamboris
12:55@rebolek I tried it on W7 and can confirm.
12:56![](https://i.gyazo.com/1439583da96ea0739d4a0101919c4daa.png)
12:58And I think there should be a separate issue for Mac that field height is incorrectly inferred automatically from font height.
rcqls
13:00Maybe on linux/GTK, field sizes are often chosen by GTK itself when the sizes don’t fit well. This can explain why it works on linux whenever there is a bug in VID styles. But I am not sure ….
toomasv
13:10On W10 it is OK
13:10[![image.png](https://files.gitter.im/red/bugs/OFJA/thumb/image.png)](https://files.gitter.im/red/bugs/OFJA/image.png)
rcqls
13:12Great !
endo64
14:08Works on my Win10 too.
greggirwin
20:24So it looks like Red is *trying* to set it, as it works in some places, but maybe the platform specific APIs need to be used differently. Seems odd, but...

Since I can't dupe it on Win10, can someone try a couple variations:
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"
]
hiiamboris
20:36W7 - f3 doesn't get height from style, f4 overridden successfully
![](https://i.gyazo.com/b487f37770d561f9770697928b14e8ce.png)
endo64
21:36Here is the screenshot on my Win10
21:36[![image.png](https://files.gitter.im/red/bugs/bx5i/thumb/image.png)](https://files.gitter.im/red/bugs/bx5i/image.png)

greggirwin
00:54Thanks guys.
ralfwenske
01:03@greggirwin modified version on my mac:
![alt](https://ralfwenske.net/Screen%20Shot%202019-03-20%20at%2010.59.34%20am.png)
greggirwin
03:30Now we know only an explicit override of the height works. Thanks!
gltewalt
18:42Seems to be an issue with q. Things like print q kills the GUI Console, and exits the CLI console.
18:42Should error?
rebolek
18:43print evaluates, so it's expected
gltewalt
18:46what q
18:46I don't think q should fire off if it is supplied to a function
9214
18:47@gltewalt what is a 0-arity function.
rebolek
18:47q: "tralala, I'm safe now" and it's solved
gltewalt
18:49what errors when giving an argument except for q.
rebolek
18:50it's certainly not what what errors, it what follows
18:50what q is like none q
9214
18:51@gltewalt again, what is a 0-arity function. It doesn't accept any arguments.
18:51So what q first calls what, then calls q.
gltewalt
18:53You don't see an issue with q evaluating when it isn't on a line by itself?
rebolek
18:53no, Red's not Python
18:53you can have whole program on one line
9214
18:54@gltewalt Red evaluates by expressions, not by lines. what and q are two separate expressions.
18:54You can write
what
q

If you really want to, but the effect will be the same.
gltewalt
18:56if q ["bye"] <--- I don't like
9214
18:57@gltewalt I don't follow what you're trying to say.
gltewalt
19:00I'm saying that I don't think people will expect the program to quit if they happen to use a line like if q [do stuff]. A bit unrealistic example, but chances for unpleasant surprise is there.
9214
19:01People should expect the program to quit if they explicitly call function that, according to its docstring, "Stops evaluation and exits the program" .
gltewalt
19:01And I should have posted this in the /help room, I guess, for discussion sake
moliad
19:02the real problem here is that there should not be any standard funtion called 'Q
19:02'QUIT is short enough.
9214
19:02@moliad agreed, we need either a shell-like dialect or a dedicated module for such functions.
moliad
19:03the console could have some shortcuts, but nothing beyond that
gltewalt
19:03So they should expect help q to quit the program?
moliad
19:03help q will give the definition of 'Q
9214
19:03@gltewalt help q doesn't quit the program.
gltewalt
19:04I know, but you said that they should expect to quit if q is encountered.
9214
19:04As a separate expression, gee.
19:04Following your logic, even [q] should halt the console.
gltewalt
19:05That's not my logic.
9214
19:05in if q [...] q is evaluated as an argument to if, so there's no surprise in that.
19:06in help q help soft-quotes its argument and suppresses its evaluation.
gltewalt
19:06I guess I'm saying "no q evaluation if it is an argument to another function"
9214
19:06So q is passed as-is, as a word! value.
gltewalt
19:07Or dispense with q and only have quit as stated earlier
9214
19:07unset 'q.
19:07if :q [...], whatever.
19:08Anyway, this belongs to /help room.
gltewalt
19:08Of course we can change it, but it might be better to not exist pre-defined?
19:08Yes sir. Sorry.
9214
19:10I agree that it shouldn't be pre-defined, but we don't have modules in place, and language design isn't casted in stone, so you should stick to what you have.
rebolek
19:13i like q
Oldes
19:20me too... and I like ? too... although one may say, that I can write help instead.

Oldes
09:51This piece of code crashes Red:
third write/info/binary http://google.com [GET [Accept-Charset: 'utf-8] ""]
rebolek
09:52Header values must be strings, this is not going to be fixed until new IO is ready.
endo64
09:52write/info/binary http://google.com [GET [Accept-Charset: "utf-8"] ""] work (string instead of word)
rebolek
09:53That's why I autoconvert everything to string in send-request: https://github.com/rebolek/red-tools/blob/f2e4cba2d2c2a19caa4b952054d1e88c1d6cdb01/http-tools.red#L224
Oldes
09:54I know... but it should not crash.
endo64
09:54But it should not crash for sure, there was a ticket for that I think.
rebolek
09:55IIRC it's not going to be fixed, because that code will be rewritten, so it makes no sense spending time on it.
endo64
10:10Another issue about face flags, it looks like the first used flag takes the priority and the rest doesn't get in account:
>> view [fld: field no-border all-over on-over [print "."]] ? fld/flags
FLD/FLAGS is a word! value: no-border

It should be [no-border all-over]
It looks easy to fix but before I make a PR better to ask here.
rebolek
11:06> easy to fix

it should, if you understand how layout works. :smile:
11:31@endo64 are there any tests for stuff like this? (styling)
endo64
12:52@rebolek Not that I know.
dockimbel
15:49About the q discussion above, q is predefined only when running code from the console. It's an handy shortcut that exists in Rebol console too.

gltewalt
20:46Ok, I wasn’t aware that it was only predefined in a console session

vazub
19:00Not sure if this is a bug or expected behavior, but multi-line comments inside parse rule block seem to be failing. Example:
parse "" [
    ; test comment
    (print "one-line comment passed")
    comment {}
    (print "multi-line comment passed")
    thru end
]
19:05The first print command succeeds, yet the second doesn't, and parse returns false, without ever getting to the end.
9214
19:21@vazub 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][]
19:27In fact, any word in Parse rule that refers to a function is used to match that function in input series:
>> parse reduce ['a 'b :comment 'c][2 word! comment 'c]
== true
>> parse reduce [:add :add :divide][2 add divide]
== true
vazub
20:44I see, thanks for clarification. My initial assumption was for multi-line comments to work similarly to other languages, although I missed the fact that comment is a word on its own here.

greggirwin
18:28@vazub correct. Red has no multiline comment syntax, though in regular Red evaluation, you can just use a multiline string and it's evaluation will be ignored. Not a great solution, which is why comment exists.
9214
18:48@vazub you can use this dirty hack as a workaround:
#macro comment: func [v][[]]

vazub
11:31Thanks @greggirwin and @9214 ! It's not that I can't live without having multi-line comments within parse rule block. It's just a bit of a "gotcha" coming from other languages and adjusting one's mindset to different ideas. And technically, I could still do multi-line with comment, although using parens around it. Not as intuitive as having multi-line built-in, but will get the job done anyway.
greggirwin
18:39It is kind of a gotcha, because dialects in Red are so invisible.

dockimbel
15:18@vazub Red has much more built-in literal forms than other mainstream languages, so finding a multi-line comment syntax that does not collide with an existing syntax _and_ is readable/friendly/non-esoteric is quite a challenge.
vazub
21:22@dockimbel The more I get to know Red, the more I understand that! It is a fabulous language, yet everything comes with it's price, for sure. Although since you already mentioned that, did you guys consider something of sorts using semicolon and curly braces together to do multi-line? Like this:
;{ ignored 
text 
here }

Please, forgive me if this sounds like a horrible layman's idea for lots of reasons I might not be aware of - just something that popped into my mind right away. And sorry for bringing it up here, I know this is probably a wrong room for such discussions.

Oldes
20:32Is it by design, that there are /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
hiiamboris
20:52@Oldes makes sense to me: one is for UTC time value modification, another for translating it into another TZ. I'd work on names though - very confusing...
Oldes
20:53Do you have any idea for better names?
hiiamboris
20:54not yet ☺
Oldes
21:30Another thing... in 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
greggirwin
21:33@Oldes, yes, it's by design. From an old blog entry: "/timezone: changes the zone and adjusts time accordingly (UTC-invariant)". It's in the standard docs as well: https://doc.red-lang.org/en/datatypes/date.html#__zone
Oldes
21:34@greggirwin Thanks for confirmation... what about the second question?
21:35I believe that it is by design too as it is used in to-utc-date function.
greggirwin
21:35You have to have a time value if there's a zone. Otherwise it's not a valid date! (lexically).
Oldes
21:35Btw... I wonder if it would not be more _rebolious_ to have to-date/utc instead.
21:37@greggirwin I know I need the time... question is, if one would not rather have an error, because don't want date-time value, but only date.
greggirwin
21:49Giving it some brief thought, and scanning some code, I think it's best the way it is now. You can't have a date-only value with a zone, but you might want to set the zone before setting the time value. Of course, we can tell users that you have to set them in a certain order, but imagine a UI where the user can select zone and time values. Do we want to enforce the order there, or require the use of temp vars?

Let me ask the other question. What is the harm in not throwing an error?
Oldes
21:51No harm... in my opinion... I just wanted to be sure. I prefer this behaviour.
greggirwin
21:52to-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?
21:53@gltewalt, when you have a chance, maybe add a note to the date docs that if you set a zone for a date, and there is no time value already set for the date, it will default to 0:0:0. Thanks.
Oldes
22:10@greggirwin I'm for customization when appropriate instead of having bunch of to-*-* functions.
greggirwin
22:19The question then is how many extra to-* funcs do we think we'll need? They haven't proliferated since R2. UTC and local are a special case for dates. Would we also want 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.
Oldes
22:22I don't have strong opinion on that. Maybe you are right.
22:25I just know, that I tried to avoid use 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.
22:28For example:
>> to-string/from #{9AE96D} 'cp1252
== "šém"

although internally it could be implemented as:
>> iconv #{9AE96D} 'cp1252
== "šém"

the difference is, that a newbie can use help to-string and see some information without knowing, that there is also iconv native or codecs for such a conversion.
22:31But maybe it is just nonsense... sorry.. just brainstorming now.
greggirwin
22:43I think Carl once questioned the value of the to- funcs, but explained that they were created because the 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.
Oldes
22:47Yes. I don't want to remove them.
hiiamboris
22:57I always thought to- funcs are for the functional future ☺ Like map :to-string [1 'two @three]

greggirwin
00:19They're handy for those to @hiiamboris.
temperfugit
00:25
Red [needs: View]
view [  
	canvas: base 540x540 draw []
	on-down [print event/offset]
	on-wheel [print event/offset]
	on-created [set-focus canvas]
]

Is it supposed to be the case that on-wheel returns different coordinates than on-down?
greggirwin
00:49It's by design AFAIK, that the screen offset is used for wheel events. @hiiamboris has this in his wheelhouse I'm sure, and @qtxie is the source of record. But we should confirm on MacOS and now GTK (@rcqls ?).
temperfugit
03:12Okay, thanks @greggirwin, that makes sense.
rcqls
07:01@greggirwin Not yet implemented in GTK but now I have some help to implement it.
PeterWAWood
07:18@greggirwin These are the results on macOS when I move the mouse-wheel though the mouse pointer is static:
>> 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
...
07:21The behaviour seems correct on windows:
>> 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

The small difference in the values reported are due to me moving the mouse when "wheeling".
hiiamboris
09:50@greggirwin I think I never made this into an issue. Just converted the coordinates. But I don't see the point of having wheel offset relative to the screen, so it looks like a bug to me. Offsets are there for comparison with some face corners, and what are you going to do with a screen-relative offset? Compare it with what? The only face that is in screen coordinates is the top-level window, but why would anyone match the top window geometry from a child face's actor?
greggirwin
17:35It looks like they aren't useful at all on MacOS, so time for @qtxie to weigh in.

@hiiamboris my first instinct was that it worked that way because, at least on Windows10, you have the option of getting wheel messages sent to a non-focused window. Let's you move the mouse around and scroll different windows without changing focus. But only one window gets the message. That is, you don't get the message in any way, which makes sense, if you have focus, unless the mouse is over you. So my thought that you could use it for windowing tricks doesn't pan out.

The likely cause is that the params are just being sent up the event chain, without Red processing them in any way. We can use them either way, but I agree that it would be more consistent to have them as face-local values. I don't remember ever using the offset in R2, but you could.

gltewalt
22:58@greggirwin Done

greggirwin
00:06Commented. :^)
gltewalt
00:14How about now?
greggirwin
19:21Merged.

dander
00:55this demo doesn't seem to be loading for some reason
>> 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
greggirwin
03:17That core file isn't a demo. Here's the issue: https://github.com/red/red/issues/3595
dander
03:55okay, thanks for the clarification

bitbegin
08:58
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>
08:59latest version can't produce console file
greggirwin
16:20@bitbegin I just pulled the latest and it builds fine here on Win10.

9214
16:33Can anyone paste view [field on-key [probe event/window]] in console and confirm that field ceases to function as expected?
ne1uno
16:47probe after each key, win7 RED: [ branch: "master" tag: #v0.6.4 ahead: 197 date: 22-Mar-2019/21:33:44 commit: #a76753122
toomasv
16:54@9214 Confirmed on W10.
9214
16:55@toomasv thanks.
toomasv
16:55:+1:
ne1uno
16:56win7 too, not echoing characters, forgot I was using old gui
9214
16:57@ne1uno OK, thanks.
gurzgri
17:00@9214 Field ceases to work only when run in Red Console, works fine when run in --cli mode with Red 0.6.4 for Windows built 13-Apr-2019/8:27:16+02:00 commit #fb18d4e
9214
17:03@gurzgri well, yes, that's why I specifically asked to check it from console.
gurzgri
17:04@9214 Sorry for the noise
9214
17:05@gurzgri no problem at all, thanks for reporting anyway!
17:05macOS users, anyone? @rcqls can you check the above on your branch?
rcqls
17:15@9214 probe event/window does nothing in my branch compared with macos where none is printed.
9214
17:15@rcqls and field isn't updated either?
rcqls
17:17@9214 Sorry, what do you mean by updated? Typed keys are shown as expected….
9214
17:18@rcqls yes, that's what I mean. On Windows field ignores everything you type, but probe returns window's object!, not none.
rcqls
17:19@9214 Ok but I don’t have window's object returned….
9214
20:57:suspect:
>> /.0.
== /.0.
>> last 'wtf/.0.
== .0.
>> type? last 'wtf/.0.
== word!
21:01OTOH, it's indeed a valid word!, albeit the one that lexer recognizes as invalid float!.
>> .0.
*** Syntax Error: invalid float! at ".0."
*** Where: do
*** Stack: load
rebolek
21:02I thought Red abandoned .1 syntax. In that case, .0. would be valid word.

greggirwin
06:14@9214 something about cycle handling perhaps. It's the parent facet that's the problem it seems.
17:04view [field on-key [probe face/parent]] does it too, but not general object cycles it seems.
9214
17:05@greggirwin so, how should I name a ticket?
17:05This also affects area.
17:06BTW, is it expected that field and area react to input in deferred mode?
17:10e.g.
>> system/view/auto-sync?: no
== false
>> view [field area]

Also, see this
view [t: text "" field on-key [append t/text event/key]]
greggirwin
17:23I believe auto-sync only affects non-interactive updates for native widgets. That is, events are processed by the OS if we don't override them individually.
17:31
view [field on-key [p: face/parent p/parent: none  probe p]] ; OK
view [field on-key [p: face/parent probe p]] ; Not OK

For a ticket description, how about: Probe face/parent interrupts field/area event handling.

From there we can add more details as we find out if other styles are affected.
17:31And print mold does the same thing, so it's not returning the value, as probe does which causes the problem.
9214
17:46https://github.com/red/red/issues/3848

What about event-eating text? Can anyone confirm that?
view [t: text "" field on-key [append t/text event/key]]
hiiamboris
18:16@9214 Yes, on W7.
toomasv
19:26@9214 With on-key-up it kind of works, but uppercases.
greggirwin
19:31What's the event-eating issue with text? Seems OK here on Win10. Or I'm not caffeinated enough to see what I'm missing.
hiiamboris
19:37@greggirwin ![](https://i.gyazo.com/0f7edc6cf2f0e6f53772bb08d871f1c7.gif)
greggirwin
20:02Ah! Duh. I was watching just the text, thinking that was the problem. :^\

rcqls
01:05view [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.
dockimbel
13:42@rebolek We abandoned 1. syntax, .1 is still valid.
13:43@hiiamboris I can't reproduce that issue, it shows the characters properly here on my W10.
rebolek
13:47@dockimbel ah, thanks for clarification
dockimbel
13:58@vazub Thanks for your kind words about Red. Indeed, it's all about trade-offs, can't have everything. About your ;{...} 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?
14:01@Oldes
> Do you have any idea for better names?

Better names for differentiating /time and /timezone are welcome.
Oldes
14:37Welcome back @dockimbel ! I'm not good in inventing new names. Especially in english.
14:41Regarding ;{...} 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.
vazub
14:54@dockimbel Correct, that idea was for multi-line comments.
@Oldes One of the reasons why this specific syntax seemed logical to me - was that it is supposed to be based on current Red's foundation for denoting comments. /*...*/ 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.
Oldes
14:57Main problem with ;{...} 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.
9214
14:59How ;{...} would handle this?
;{
{}

Is this a one-line comment followed by an empty string or a multi-line comment with { in it? In the latter case you'll need to escape {, which is at odds with the very definition of multiline comment.
hiiamboris
15:00I'm thinking like @Oldes and @9214. The problem of ;{..} 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.
moliad
15:00nope. ;{ ... } bad idea... even the syntax agrees.... ; {
15:01comment [ ] already works, just specify a shorter statement and make it clear that its a LOAD concept.
9214
15:02Red as a very tight lexical space. Instead of squeezing multiline comment syntax in it, I'd rather took a step back and considered something like reader macros.
moliad
15:03I was thinking of adding a generalized form for code hiding in LOAD by using ##ANY-KEY-YOU-WANT [ ... ]
15:03data in the block gets eaten and doesn't traverse the LOAD.
9214
15:03@moliad problem with comment is that it's not truly invisible, and also returns unset. Something like
#macro comment: func [v][[]]

Is IMO more to the point, but too ad-hoc-ish.
moliad
15:04which is why COMMENT should be managed inside of LOAD... its very easy to add.
hiiamboris
15:04#comment will be better at hinting that it's a preprocessor stuff.
moliad
15:04(if it's not already done this way)
9214
15:05And, more importantly, ;{ looks like a sad drunken cat.
dockimbel
15:05@Oldes Both /* and */ are valid any-word! values, so it would be painful to support, as that would introduce exceptions in words lexical space...
moliad
15:05@9214 that's what I meant by even the syntax disagrees with the idea ;-)
dockimbel
15:05@9214
> How ;{...} would handle this?

Good point, it needs to differentiate enough with line comments to avoid ambiguity.
15:11@hiiamboris That's an option. Though the processing is done after load, it would be better if we can find a specific syntax that is part of the lexical rules.
nedzadarek
15:11What if ;{} behaves like comment {}?
dockimbel
15:13@nedzadarek 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.
nedzadarek
15:14I see
9214
15:14In Forth, for instance, \ 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:
moliad
15:14comment should not be a function it should be a statement within load.
Oldes
15:17I guess, that 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
15:17But that is easy to fix.
vazub
15:17How about ;-- ... -- then? Probably easier to parse, and already partially used as a style convention in Red.
9214
15:18@vazub same problem
;--
--

Is it a one-line comment followed by -- (a valid word, FYI), or a multi-line comment?
Oldes
15:18The problem is that for example I use the char after ; in syntax highlighting.
vazub
15:19@9214 How do C-like languages treat it for /*?
/*
*
Oldes
15:19[![image.png](https://files.gitter.im/red/bugs/Uymh/thumb/image.png)](https://files.gitter.im/red/bugs/Uymh/image.png)
moliad
15:19just don't use ; for multi-lines :-) unicode has thousands of characters. we can use this to our advantage
Oldes
15:20@vazub it simply goes to the first */ sequence.
moliad
15:20a VERY limited number of people use mutli-line comments. they always end up being more hassle than they're worth
vazub
15:20@moliad The convenience factor? I would assume not many keyboard layouts allow you to use any Unicode character aside of typical ones.
moliad
15:21yep, then again, single line comments have become the norm on all projects and IDEs I see.
Oldes
15:23I still believe, that we could just not have /* as an valid refinement. */ is also not valid path.
9214
15:24@vazub lexer will simply yell at you because of unmatched /*
$ echo "/**" > test.c && gcc test.c
test.c:1:1: error: unterminated comment
 /**
 ^
vazub
15:24@Oldes so maybe ending with a semicolon would do the same trick? ;- ... -;, ;{...};
Oldes
15:25;{...}; could work.
9214
15:25At this point I think this discussion should move either to /sandbox or /chit-chat.
15:27
text
;{
{};

A one-line comment followed by an empty string and another one-line comment, or a multi-line comment?
Oldes
15:28multi-line comment.
vazub
15:28Multi
15:29Parser should check for next char after ; and if it finds { - it treats it as multiline. Like a single token ;{
9214
15:29An *ambigious* multiline comment is even worse that absence of multiline comments in the first place.
moliad
15:52one hurdle to adding this is the amount of code that already exists in the wild. all the given examples of using ; 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.
15:53(Like Oldes shows above)
15:54I use ;- a lot in various ways. I've also used ; for some stuff
vazub
15:55@moliad although I do understand the concern, the argument might not hold true, as Red continues to evolve - it is not even 1.0 yet, so there might be lots of things breaking someone's code along the way.
moliad
15:56yep. which is why I am builidng R2-backwards.Red in one project ;-)
15:57but **don't touch my comment marker ** :smirk:
15:58(as emotive a reaction as is possible ;-)
nedzadarek
19:46@moliad
> just don't use ; for multi-lines :-) unicode has thousands of characters. we can use this to our advantage

I prefer easy to type ASCII
endo64
21:14> And, more importantly, ;{ looks like a sad drunken cat.

I laughed =)

hiiamboris
17:49wow interesting...
confirm somebody plz in the GUI console:
- set gui-console-ctx/terminal/color?: yes
- then type '/ 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

9214
17:57@hiiamboris yep.
hiiamboris
17:58thanks ☺
greggirwin
21:58We can move the comment chat to red/red. It's fine for general language design.

endo64
06:57@hiiamboris Same for '%
greggirwin
17:29@qtxie's fix seemed to take care of that too @endo64.
ne1uno
17:40old gui is crashing now
greggirwin
18:15@ne1uno can you be more specific?
ne1uno
18:30run crash
18:32some code changed outside of red-master\environment\ so I have no clue
greggirwin
18:36"run crash" is no more helpful than "old gui crashing". I just pulled and built recent source, and all runs fine here. What exactly are you running, how are you running it, and what OS?
ne1uno
18:48thanks, maybe it doesn't like something in cfg. too many consoles sharing the same one. win7. run old-gui, crash. not sure what else can be said
19:02I rebuild a few times a week from batch file, not sure if anything changed here. previous builds still work
greggirwin
19:30What is the difference between "previous builds" which still work, and "old GUI"? Now I'm pretty sure you mean GUI console, not a GUI app of yours. A new build, and changes, should not affect old console builds.
ne1uno
19:40old-gui crashes when it is started w/nothing on commandline. I never used cfg setting, maybe can point to empty cfg to test that is the problem?
20:08still crashing for me with deleted or new `c/programdata/red/console.cfg.red.
20:25built with rebview276 same as rebol-view-278
greggirwin
21:06Does the automated build work for you?
ne1uno
21:25red gui & cli are fine
22:11old gui, isn't in the automated builds, probably doesn't get tested. red-master\environment\console\GUI\old\gui-console.red
22:13but it has worked in previous builds, till today. it has a different way of buffering output and doesn't mess with focus like the new gui.
greggirwin
22:30Ah, %GUI/old/* is what you're talking about. One small change in %highlight.red there. @qtxie ?

qtxie
08:07@ne1uno I pushed a fix for it.
ne1uno
08:09I get a few crashers with new gui too, but couldn't isolate it. will retest
09:23👌

9214
14:13Can anyone check out how modal flag works on macOS?
https://gitter.im/red/help?at=5cb9edc34b4cb471d922a96f

9214
18:46@9214 Bueller?

9214
19:39@rcqls any news on libRed crashing issue? Is it time to file a ticket?
rcqls
19:40@9214 sorry, you can indeed file a ticket ...

rcqls
18:53@9214 I I tested the crash already observed with libRed on macOS Sierra but on macOS Mojave and Linux with View/GTK activated. I added comment just below the issue you submitted. On Mojave, i386 is deprecated and on Linux the crash is the same only when View is activated.
9214
18:54@rcqls thanks a lot!
rcqls
18:54@9214 You’re welcome!
hiiamboris
19:04This seems strange:
Red []
x: [1]
if single? x [print "TRUE"]

I can't compile this with -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"]]

Same goes for unless instead of if. I can however compile it with empty? or some other function in place of single?.
greggirwin
21:51Confirmed. Strange indeed.
21:52Good catch.
hiiamboris
23:45@greggirwin do you think it's worth a place on the tracker or on compiler limitations wiki page (and if so, what's the nature of the limitation...)?

greggirwin
00:30It's something for @dockimbel to comment on, but you can make a ticket for it, so he can comment there, and then decide if it's an easy fix or a limitation we should note.
hiiamboris
18:48Ok! #3862
9214
22:30:suspect:
>> 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:
22:33But
>> foo: func [:a :b][1] foo + -
== 1
>> etc...
hiiamboris
22:43Even better:
>> 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
9214
23:08[Oh my...](https://www.youtube.com/watch?v=U6MlaIe1ljs)

dockimbel
12:03@hiiamboris
> This seems strange:
>
> Red []
> x: [1]
> if single? x [print "TRUE"]
>

> I can't compile this with -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"]]                                              
>

> Same goes for unless instead of if. I can however compile it with empty? or some other function in place of single?.

The way the single? function is defined is not compatible with the compiler:
single?: last?: func [
12:05The compiler processes those runtime source files specifically to extract function definitions. Currently, the compiler only recognizes name: func and name: :other-name patterns for defining functions.
meijeru
12:10The quickest way to remedy this seems to redefine last?: func [ ] [ ] and single?: :last?.
hiiamboris
12:11@dockimbel I tried to reverse the order in functions.red: last?: single?: func [ but it didn't help. Still complains about single? but not last? when I invoke red.r on that file.
dockimbel
hiiamboris
13:40@endo64 would you like to write a fix for https://github.com/red/red/issues/3862 ? ☺
endo64
14:26@hiiamboris Sure I will do it, I remember I saw that pattern somewhere in the source codes hence I did it the same way.
14:56Fixed, https://github.com/red/red/pull/3865
hiiamboris
17:35:+1:
greggirwin
18:53> I remember I saw that pattern somewhere in the source codes hence I did it the same way.

It's certainly an old Rebol pattern. If you can find it in other parts of the Red source, we should fix those as well.
18:54Who wants to whip up a Red Source parse tool for finding patterns? :^) Could be a fun auto-refactoring experiment.
hiiamboris
19:09Quite a task if done properly I think...
greggirwin
19:16Starting simple shouldn't be too bad. In this case, you're looking for set-word! set-word! ['func | ... ], right?
meijeru
19:18A simple grep on all source files will do. My own (fairly primitive) grep found just the one single?: last?: instance.
hiiamboris
19:19@greggirwin Yeah I just wonder how far your idea of "auto-refactoring" goes. Compression algorithms? Machine learning? Man, a whole career can be built on that topic :)
greggirwin
19:20But you have to know the names in that case @meijeru, or regex it. ;^\
19:21@hiiamboris, I always try to start small. Nowhere near big stuff for this. I propose ideas that seem either too limited or too hard. :^)
19:22So think of it as a linter first.
meijeru
19:24Of course, my grep does a regexp.
19:26The most surefire is to include all allowed word characters in the regular expression, but I gambled, in first instance, that the function names used in the Red source would be lowercase, containing at most ? * and - .

dockimbel
10:04> It's certainly an old Rebol pattern. If you can find it in other parts of the Red source, we should fix those as well.
10:06No need to do that, the issue is only with those specific files in %environment/ folder that are specifically processed by the compiler to extract some definitions.
greggirwin
22:45Good to know.

gltewalt
21:11Should this be?
>> #"g" + 1
== #"h"
>> 1 + #"g"
== 104
21:12Result cast to the type of the first arg?
endo64
21:21First one uses the add native from char datatype, second one uses add from integer datatype.
gltewalt
21:22Should we note that in the char! doc under arithmetic?
endo64
21:23runtime\datatypes\char.reds and runtime\datatypes\integer.reds, probably they handle parameter types differently.
21:27> Should we note that in the char! doc under arithmetic?

I think yes, only in char! doc. As Result cast to the type of the first arg is not exactly correct for integer! + other-types
21:281 + 1:2:3 will return time!, 1 + 2x3 returns pair!.
gltewalt
21:29Interesting.
endo64
21:30It is a feature of char! datatype, how it implements + action. And other op!s as well:
>> #"b" / 2
== #"1"
>> #"b" % 2
== #"^@"
greggirwin
23:06This is where a little Lab utility would be great. One of my old ones might be close.

rebolek
10:21Prompt doesn’t like newline very much:
>> system/console/prompt: "...^/>>"
== "...^/>>"
...
   >>
...
   >>
...
   >>

dockimbel
11:00@endo64
> 1 + 1:2:3 will return time!, 1 + 2x3 returns pair!.

Multi-dimensional types take precedence other scalar types, as conversion to scalar values makes little sense in those cases.

rebolek
06:51Should this be allowed?
>> foreach [x x] [1 2 3 4][print x]
2
4
endo64
10:51I see no good reason to not allow.
rebolek
10:51so what is it good for?
endo64
10:56Same question is for not allowing. It is not a definition, not something like f: func [a a] [] ;*** Script Error: duplicate variable specified: a, so restricting doesn't have any value, even it is useless.
11:05And what about if both x are bound to different contexts.
11:05
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
]

rebolek
11:06interesting :)
endo64
11:11This is one of the biggest difference between Red and Rebol for me, 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.
11:12Also note that, R2's output is different.
>> foreach [x x] [1 2 3 4] [print x]
1
3

R3's output is same as Red.

greggirwin
00:58The binding example there is a good one @endo64. That's going to send a number of brains down rabbit holes. ;^)

gltewalt
05:11rejoin seems to eat leading / characters in urls
05:16Oh, / is illegal character in ASCII subset for word!
05:19Disregard, I guess
05:21
>> rejoin [http://one/two /three]
== http://one/twothree
>> rejoin [http://one/two '/ 'three]
== http://one/two/three

endo64
06:10It's the refinement!,
>> append ""  /three
== "three"
>> to "" /three
== "three"
>> print /three
three
>> append a@b.com  /three
== a@b.comthree
;but!
>> append []  /three
== [/three]
gltewalt
06:26Interesting
endo64
06:30I just compiled the latest version and CLI doesn't work correctly on Win10.
06:30[![image.png](https://files.gitter.im/red/bugs/V7y0/thumb/image.png)](https://files.gitter.im/red/bugs/V7y0/image.png)
06:31Can anyone confirm please.
06:32GUI console seems to work ok.
gltewalt
06:34I’m still running Win7.
Nightly build or Stable?
endo64
06:34Nightly build, just fetched now.
06:36One of these commits should be:
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!)
06:36If it's not my PC only.
06:38
-----------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 ]
--------------------------------------------

gltewalt
06:40Win7 seems to be behaving normally
endo64
06:42Thanks for testing, waiting for someone to test on Win10 before raising a ticket.
07:12There is more, after updating the latest version, my below batch script that I use to start Red/CLI console:
@echo off
d:
cd D:\Projects\Red\red\build\bin\
red.exe --cli --catch user.red


gives a strange error now:
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
]


so I should dig to find what is causing this error in my user.red file.
hiiamboris
07:49@endo64 looks like my overlook somewhere...
07:54you can remove --catch before it's fixed
07:55you shouldn't be needing it with a script anyway
08:21FYI --catch is some historical remnant that should only hide the banner when run with --cli, but that doesn't work since 061 or before
08:22the only info about it I can find says: catch?: no ;-- YES: force script to fallback into the console so it was probably originally meant for something else
dander
08:31@endo64 I am experiencing the same as you on Win 10
hiiamboris
08:43wait, now I get what it does! just no idea why it works ☺
endo64
08:49What I want by red.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.
hiiamboris
08:51Yeah I see it now ;)
12:14@endo64 for the catch issue I've opened a PR https://github.com/red/red/pull/3879 so we'll just wait for Gregg to pull it. Thanks for noticing the bug :)
12:15For the newline issue, it's probably trim-related? I didn't change anything in that part. And on W7 and linux it does not appear.
12:22I'm still very **very** curious about one thing. @qtxie maybe you can tell?
The only place where --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 true
the catch? 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/run
In console/run this refinement [only affects the header output](https://github.com/red/red/blob/1dc4661ef7a7040455351d96e428f418e256e518/environment/console/engine.red#L224) but nothing else
So how come that with --catch console does not quit after the script execution???
Magick? :fireworks:
9214
12:56@hiiamboris --catch flag is specifically created for that - fall thru to console instead of closing it after script finished running.
hiiamboris
12:56but how does it work? :)
12:59I mean I absolutely don't see how can it affect the closing of the console. Yet it does. Somehow.
9214
13:18You haven't checked [command-line front-end](https://github.com/red/red/blob/master/red.r). See where run-console is called and how --catch affects it.
hiiamboris
13:23@9214 it just passes the --catch flag to the console command line (inserts it before the script name)
dockimbel
14:22@hiiamboris See [this line](https://github.com/red/red/blob/master/environment/console/engine.red#L271), no catch flag -> no call to run -> no console -> exit.
hiiamboris
14:59@dockimbel Right! thank you :) for some reason I thought there'll be just run otherwise. I see now.
endo64
15:39Any idea why latest build of CLI console behaves weird?
greggirwin
17:21I've merged @hiiamboris's fix, but still see the problem in the CLI console.
20:02Let's hope @qtxie or @hiiamboris chime in with more thoughts or ideas. They'll be the quickest at figuring it out I think.

luce80
17:36shouldn't 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
toomasv
17:43@luce80 Nope
>> remove-each item bl: [a 1 2 b 3] [integer? item]
>> bl
== [a b]

It's like foreach. Altough I agree, that it would be nice to return modified block.
luce80
17:49@toomasv you are "probing" the instatiated modified block, not the function itself. By returning modified block we could "cascade" it like remove-each ... remove-each ...
toomasv
17:50Yes, because you showed already that function returns unset. :) And as I said, it would be nice to have modified block returned.
greggirwin
17:58It's an open question. An alternative is to return the number of items removed (which is more work to figure out). Until a winner emerges, it doesn't return anything so we don't break code when it changes.
toomasv
18:03@greggirwin Or maybe removed items collected on request? :eyes: (Which would make it essentially a partition)
luce80
18:12@greggirwin Or maybe as Rebol2 does . (Which makes it essentially a filter) (forgive me if I am argumentative)
greggirwin
18:59remove-each *is* a less ambiguously named filter. :^)
19:00BUT, there's one big difference. It modifies the series in place, and so is much more efficient.
hiiamboris
19:19> so is much more efficient.

I wouldn't count on that ☺ A lot of removes from the series head may be slower than a lot of appends to a newly allocated buffer.
greggirwin
19:54Good point. Time to profile. Under R2 I think it did a bulk shrink after all removals, but Red does not.

endo64
07:21remove-each/into could be interesting, but it is unclear that it will append the items removed or the rest.
toomasv
08:21@endo64 Yes, with help-string "Removed items are collected into provided block" or something like.
greggirwin
18:28We can write take-each for that.
toomasv
19:45:+1:

Oldes
14:02
>> 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
14:02This is still not fully fixed: https://github.com/red/red/issues/3631
hiiamboris
14:02confirmed
GiuseppeChillemi
14:35I am using extensively my RED note management software and I am suffering sudden crashes with no error output at all (it should pass at least 1 ohur or more). It simply closes and GUI disappear when interacting with it. Even moving the mouse from the inside to the outside of the main window, or clicking on a text area could let it crash. Any clue on how to have some debug info for you ? RED 0.6.4 here.
hiiamboris
15:48@GiuseppeChillemi build a GUI console from the sources
15:50@GiuseppeChillemi or even better, add 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" command
15:51Unfortunately most of the random bugs stop from happening when you do that ☺
dockimbel
16:51@GiuseppeChillemi Is your app compiled or interpreted from the console?

1. Disable the GC using recycle/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.
2. Compile your app using -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.
GiuseppeChillemi
21:47@dockimbel compiled using: red.exe -c -e -r -t windows
dockimbel
23:01@GiuseppeChillemi -c and -r are mutually exclusive.

ne1uno
22:54view [ text 30x600 react [ face/text: tarea/text ] tarea: area 300x400 ""]
22:54*** Script Error: cannot access area in path system/view/metrics/colors/(face/type)
22:54area or any other face type. not sure if it's related to react, this is just the smallest example so far
22:54RED: [ branch: "master" tag: #v0.6.4 ahead: 283 date: 23-May-2019/14:03:51 commit: #986ecc30b] Win7
endo64
23:11
>> 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 ]


23:13Same for field, button, check and radio faces. Probably a regression of latest commits about maps.
greggirwin
23:33Yes, though I think maps should have parity with blocks in path access on missing keys, rather than changing the view system. This is a tough call, and it was decided to match object behavior, but maps are more dynamic, by nature.
23:34To determine a key's existence, then, you need to use find, as with blocks.

koba-yu
06:24Hi, I updated Red binary today and VS code extension stops showing intellisense and mouse over popups.
Should I raise a ticket for it?
I get the issue Windows 7 and 10.
greggirwin
06:28@koba-yu let's see if someone can confirm it first.
koba-yu
06:29@greggirwin I see, thank you for your response
Oldes
14:58In Rebol2 was possible to write this:
>> x: 10
== 10
>> - x
== -10

but its not supported in Rebol3:
>> - x
** Script error: - operator is missing an argument

neigher in Red:
>> - x
*** Script Error: - operator is missing an argument
*** Where: catch
*** Stack:


@dockimbel is this by design?
14:59(note that I know I can use negate x)
rebolek
14:59@Oldes I believe so. It's basically abuse of op!.
15:02AFAIK, Red wants to properly honor arg arity, so - 10 is invalid expression.
greggirwin
16:09It is by design.
dockimbel
17:01@Oldes By design. See to what mess it leads in R2:
>> + 10 4
== 14
>> - 10 4
== 4
Oldes
17:02Interesting... I never noticed this. Thanks. Makes sense now.

bitbegin
01:39
>> a: make map! [b: 1]
== #(
    b: 1
)
>> find a 'b
== b
>> a
== #(
    b 1
)
>>

01:40found an issue about map! on daily version
greggirwin
02:39Confirmed. Good catch.
02:41
>>  a: make map! [b 1]
== #(
    b: 1
)
>>  find a first [b:]
== b
>> a
== #(
    b 1
)
>>  find a first [b:]
== none
dockimbel
14:21@qtxie ^---
Tovim
15:46Hi, my Windows 10, Red 25-May-19 returns true:
>>  a: make map! [b 1]
==  #(b: 1)

>>  find a 'b                         ;  or
>>  find a first [b:]             ;  returns
==true



ne1uno
15:59you don't have remove/key too? that date seems wrong
qtxie
16:01 @bitbegin @dockimbel Pushed a fix.

endo64
11:08Below script crashes when compiled:
Red []
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


Can someone confirm please?
11:09I tested on Win10 with latest nightly build.
hiiamboris
11:13@endo64 Don't bother filing it. It's a known bug. There's a PR https://github.com/red/red/pull/3894 to fix it but it'll likely take some time before it gets noticed and accepted.
endo64
13:45@hiiamboris Thank you

temperfugit
02:57
>> a: #("one" 2 "three" four)
== #(
    "one" 2
    "three" four
)
>> select a "one"
== 2
>> remove/key a "one"
== #(
    "three" four
)
>> select a "one"

That last line causes my GUI console to close on Windows 8.1.
greggirwin
03:07Confirmed @temperfugit. Please file a ticket, and note that a/("one") doesn't cause the problem, only select does.
temperfugit
03:22Submitted! https://github.com/red/red/issues/3903
GiuseppeChillemi
11:30If you have a GUI with different AREAs and text inside, could you try to rapidilly scroll UP and DOWN with the mouse wheel ? In my program this causes RED to crash after some time.
11:31Maybe tomorrow I could submit to you some code.
rebolek
11:31Having code to test it would really help.
GiuseppeChillemi
12:51Try this

txt: "" loop 1000 [insert txt rejoin ["Scroll me with mouse wheel up and down continuously" lf]]
view [area txt 600x300]

hiiamboris
12:55@GiuseppeChillemi does it take long before it crashes?
GiuseppeChillemi
13:04max 10 seconds here
13:045 seconds usually
rebolek
13:04can't repro it on Linux.
GiuseppeChillemi
13:08@rebolek @hiiamboris
I forgot to add something:
mouse wheel should act as thrid mouse button too: you have to click it/unclick randomly while scrolling
13:08Here: Windows Server 2012 and 2008r2
13:09RED 31/03/2019: 49225468
rebolek
13:1031.3.2019? Maybe you should update your build, it could be fixed already.
hiiamboris
13:11No crashes on W7, built May 20
toomasv
13:17No problem on W10 (built 21-May)
GiuseppeChillemi
13:18Confirmed on 27 may 2019 build, windows 10
13:24Latest build crashes everywhere too. The bug triggers when the mouse wheel is kept pressed (third mouse button) and scrolled.
13:24(no need to click/unclick)
13:28On server version it takes less than 4 seconds. On Windows 10 it takes even 20 or 30 seconds. Note: windows versions are accessed via terminal server, windows 10 is a regular desktop. You have to be constant scrolling and moving mouse pointer too. On windows 10 it seem you need to click unclick but it is not a 100% thing.
greggirwin
13:55@GiuseppeChillemi keep trying to find a reproducible case. I can't dupe it on win10 either, using your instructions. I admit it's hard to scroll, press the mouse wheel, *and* move the mouse around all at the same time, so maybe just not doing enough.
Oldes
15:00@GiuseppeChillemi it was already mentioned, you should make a debug build and run it from console, so one can see, where exactly the crash is.
GiuseppeChillemi
16:59@Oldes

*** 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
Oldes
17:00Fine... now you should report it in the bug issue, if there is any ;-)
hiiamboris
17:00Is this all the stack trace? Just two entries?
GiuseppeChillemi
17:04Compiled using -r -d. Yes that's all.
hiiamboris
17:07@GiuseppeChillemi please raise an issue on the tracker with the provided snippet, stack trace and a link to this chat. It's at least something one can work with in an attempt to reproduce it.
17:10Although I can't help but notice that it's a curious issue here. [Line 1499](https://github.com/red/red/blob/073d19179c7b20d96a405e915bf8a2572e83b870/modules/view/backends/windows/events.reds#L1499) is just:
default [EVT_DISPATCH]
(where EVT_DISPATCH = 1). I don't see a zero division there. Could be an R/S bug or some corrupt pointer overwriting the code with junk?
GiuseppeChillemi
17:14My first bug report is here:

https://github.com/red/red/issues/3906
17:15If anything is missing please tell me I will provide the needed info.
hiiamboris
17:16I think R/S would benefit a lot from some boundary checking mechanisms in debug mode. Although the hard nut is how to find out what the boundaries are, as it's struct and array access is anything but declarative.
17:18@GiuseppeChillemi FYI you can use the same formatting there as you do here on gitter
GiuseppeChillemi
17:30Thanks, being here with you is having constant lessons and improvements.
qtxie
21:04@hiiamboris Maybe the divide by zero is in here: https://github.com/red/red/blob/073d19179c7b20d96a405e915bf8a2572e83b870/modules/view/backends/windows/events.reds#L1445
21:05But I cannot reproduce the crashes on Win10 1903.
hiiamboris
21:11@qtxie Yeah maybe. I guess it's worth patching that x / y for zero case anyway. And then we'll see if @GiuseppeChillemi can still crash it.
21:11BTW, I tried on a W10 VM (super slow) - no luck ☺
GiuseppeChillemi
22:13Ok, my psichyartist told me I have imagined everything again! 😔😄
hiiamboris
22:24@GiuseppeChillemi since you were already able to compile the debug console, maybe you could do it again after adding an 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?

GiuseppeChillemi
05:20Have I to download the whole source repository?
endo64
05:21@GiuseppeChillemi Yes, you can clone or download it from GitHub.
Oldes
15:26system/options/boot is string! and not file!, is it by design?
greggirwin
16:42I think it should, and if it's by design from an earlier stage of Red, we need to understand the use case. Should be easy to add to extract-boot-args.
endo64
20:20There is a check for 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?
greggirwin
20:29If it can never be true, yes. In R2 it was none, so maybe a change somewhere else in the boot process was made.
20:30Worth asking "why?" a couple times there.
hiiamboris
21:03> If it can never be true

Sure? What about DLLs/drivers?
GiuseppeChillemi
22:01I have tried compiling RED with:

do/args %red.r "-r -t Windows %environment/console/GUI/gui-console.red"


I get:

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
>>
dockimbel
22:07@GiuseppeChillemi Are you running the command from Red's root folder?
GiuseppeChillemi
22:13@dockimbel Dropbox locked a directory while moving files for some strange reason. I have just moved the /system dir in the right place and I am compiling RED for the first time in my life.
22:21I get an error "can't find get entry point -getgestureinfo- in dynamic library user32.dll"
22:21(Translated from italian)
22:21This happen when I run the executable
22:22Then it crashes
dockimbel
22:34@GiuseppeChillemi Are you on Windows XP?
GiuseppeChillemi
22:46Windows 2008R2
22:49@dockimbel compiled on win 10, executed on 2008 r2
dockimbel
22:49Try by compiling using -t WindowsXP. That removes the dependency on the gesture API.
GiuseppeChillemi
22:50-t WindowsXP on REBOL, isn't it?
dockimbel
22:52do/args %red.r "-r -t WindowsXP %environment/console/GUI/gui-console.red"
GiuseppeChillemi
22:56Thanks, I'll try it tomorrow morning as I have relocated into my bed to sleep!

GiuseppeChillemi
06:08@dockimbel Done, the compiled RED hangs at startup on the target machine. (Not my program, RED itself)
hiiamboris
08:27@GiuseppeChillemi what about the WS2012 machine?
dockimbel
10:04@GiuseppeChillemi What do you mean by "RED itself"? The gui-console executable?
GiuseppeChillemi
13:58@dockimbel yes.
16:44@hiiamboris on the WS2012 it works. On WS2008R2 it hangs and consumes 1.2GB of ram.
hiiamboris
16:56@GiuseppeChillemi what about the assertion you added? does it crash on assert or on divide error? (on WS2012)
GiuseppeChillemi
18:20@hiiamboris

I know I am doing something terribly stupid here but I don't know what it is !

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. 
>>


18:21Is gui-console.exe = RED.exe
9214
18:28Console is not a toolchain.
hiiamboris
18:52@GiuseppeChillemi Just gui-console buggy.red (it's .red is it not?)
GiuseppeChillemi
18:54It's .r even if RED.
hiiamboris
18:56Okay, extension doesn't really matter
GiuseppeChillemi
19:22I have run it, it crashed moving the mouse wheel but no debug info on the consolle. Compiled CONSOLE with -d option
hiiamboris
19:24@GiuseppeChillemi did you run it from command line?
GiuseppeChillemi
19:45Let me see
19:47@hiiamboris I compiled the command line using this command in REBOL: do/args %red.r "-r -d -t WindowsXP %environment/console/GUI/gui-console.red"
19:48Then I run gui-console.red from dos command prompt
hiiamboris
19:48@GiuseppeChillemi what output do you get in dos command prompt?
GiuseppeChillemi
19:48And executed buggy.r from gui-console.red
19:49No output at all
hiiamboris
19:50well, that's strange because when I compile the console with -d flag, all console output is mirrored into the dos prompt window, so even when the console closes I still see it
GiuseppeChillemi
19:52I am looking again at the whole process
hiiamboris
19:52I can only suggest you either repeat your actions or use my advice from [May 22, 2019 6:48 PM](https://gitter.im/red/bugs?at=5ce56f3e6366992a9401f691)
19:54or, using the same command line you can compile your script (instead of the console) directly
GiuseppeChillemi
19:58Compiling just now
20:02@hiiamboris, yes we have a result from executing "buggy.r" !

(Windows 2012R2 here), with added assert

*** 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

hiiamboris
20:02Finally! :clap: ☻
GiuseppeChillemi
20:03Thanks, I am feeling a deep emotion now.
hiiamboris
20:04Now you're pro. You have modified the Red sources and located a bug ☻
20:04@qtxie so now we know it's that x / y line. I suppose some drivers *do* report a zero wheel offset after all.
GiuseppeChillemi
20:06@hiiamboris
Yes, I am a pro like when I was a child an my dad let me drive the car on his legs pushing the pedals and let me move the sterring wheel with him leaving his hands from time to time ! ;-)
9214
20:07@hiiamboris can you add this info to the related ticket?
hiiamboris
20:07was there a ticket?
GiuseppeChillemi
hiiamboris
20:08right! :)
9214
20:08#3906 IIRC.
GiuseppeChillemi
20:15What are those ex numbers in stack output ? What do they rapresent to you ?

red/interpreter/eval-arguments 02600414h 02885560h 02885560h 000000
00h 00000000h
20:16In other words: how do you read stack output ?
hiiamboris
20:17it's the arguments to eval-arguments function (memory addresses)
20:17but in your case what was important is *** Runtime Error 98: assertion failed
GiuseppeChillemi
20:20I have read it.
Do those addresses contain data/code slots ?
hiiamboris
20:20Pointers to Red structures usually (so-called nodes).
GiuseppeChillemi
20:24This is why they repeat. I can seed them as being like blocks, data, passed as arguments and handed to functions. But... just my imagination !
greggirwin
20:59> Yes, I am a pro like when I was a child an my dad let me drive the car on his legs pushing the pedals and let me move the sterring wheel with him leaving his hands from time to time ! ;-)

:^) I love that.

Good work team! Thanks for the time to find it @GiuseppeChillemi and to @hiiamboris and others for helping him get there.
GiuseppeChillemi
21:45@greggirwin the time spent one RED is always well invested.

Oldes
15:47I guess we have an issue when constructing _urls_ with already url-encoded values..
In Rebol2:
>> append http://foo? "%20b"
== http://foo?%20b

While in Rebol3 and Red:
>> append http://foo? "%20b"
== http://foo?%2520b

I bet, that Rebol2 is more correct. Or am I wrong?
15:50I guess, that Rebol3 and Red are trying to be user friendly, which may work in above example, as one can do simply:
>> append http://foo? " b"
== http://foo?%20b

But the problem is, that R3 and Red does not handle other chars, which should be url-encoded, like:
>> append http://foo? " \b"
== http://foo?%20\b  ;<---- should be http://foo?%20%5Cb
greggirwin
16:23The question is how Red can know what you want. It isn't right vs wrong, but a choice. In R2 how do you get around the behavior. In Red you can use 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=

Needs a good analysis and proposal for changes.
Oldes
16:45@greggirwin according [this](https://stackoverflow.com/a/1547940/494472) \ should be escaped. I agree that it is difficult topic.
greggirwin
16:53Escaping the unsafe/unwise characters doesn't hurt anything. The question is whether they will cause problems if unescaped. For example, what are you using \ for?
Oldes
16:54I'm not using it.. it was just a randomly picked char which I was expecting to be escaped
16:58It looks that Red is escaping just chars, which are supposed to be invalid in its lexer (delimiters)
17:26Ok... I take it back... looks like Red and Rebol3 are not bad as I thought... it is the result from mold, which is confusing... this results looks logical now:
17:26
>> 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"
greggirwin
17:43Good info for a url! wiki page.

raimundasa
10:51After updating my Gentoo Linux system I cannot run Red. All versions, two different computers.

$ red

*** Runtime Error 32: segmentation fault
*** at: B7E54C48h

$ ldd /usr/local/bin/red

linux-gate.so.1 (0xb7f48000)
libm.so.6 => /lib/libm.so.6 (0xb7e5d000)
libdl.so.2 => /lib/libdl.so.2 (0xb7e57000)
libc.so.6 => /lib/libc.so.6 (0xb7c7b000)
/lib/ld-linux.so.2 (0xb7f49000)
12 $ ldd --version
13
14 ldd (Gentoo 2.29-r2 p3) 2.29

endo64
06:57make-face/spec 'base [red] hangs the CLI & GUI console. Tested on Win10.
dockimbel
09:28@endo64 I'm opening a ticket for it, as I stumbled upon similar problem yesterday.
09:49@raimundasa Did you find the change that make it crash?

Re-git
20:51Intelisense, auto completion and hover to view function definitins does not work using VScode Red extension. I'm on a freshly installed windows 10 and i'm using the most recent daily build of Red. Syntax coloring and Interpret as well as compile shortcuts work without problem.
dockimbel
21:00@vejitatoja Thanks for the report. Can someone else on W10 confirm that? If confirmed, please open a ticket in https://github.com/red/VScode-extension repo.

koba-yu
03:19@dockimbel @vejitatoja
:point_up: [May 24, 2019 3:24 PM](https://gitter.im/red/bugs?at=5ce78e04ecdf942b4c376d1f)
On my PC(Win 10 and 7), with 2019-3-19's red binary, VS Code Extension works. However after some day of May, it does not work.
endo64
05:15On my Win10, syntax coloring,
05:17and intellisense works. autocomplete of functions, go to def. and hover doesn't work.
bitbegin
07:52@vejitatoja @koba-yu @endo64 @dockimbel published a new version to resoled this issue, please update it
dockimbel
11:56@bitbegin Thank you for the quick fix!
koba-yu
13:05@bitbegin I have just tried the new version and it works on my Win 10. Thank you for your fix!
Re-git
15:39Thank you for fixing it so fast! Everything works again.
15:50I have noticed that image! datatype is not being garbage collected and that makes my script crash after some time. Is there a way to manually clear something from memory?
dander
16:56Thanks @bitbegin! The plugin is really fantastic. Thanks so much for your work on it!
greggirwin
18:02@vejitatoja, unfortunately, no. Nothing you can do manually.
dockimbel
21:32@vejitatoja Garbage collecting image! values is on our short-term todo list (should be done this month), we discussed about it earlier today in the core team. In the meantime, it should be possible to write a routine to release the system resources allocated by the image, but it's low-level code and OS-specific. Also, it would preclude your script from running from the console, it would need to be compiled every time.
@qtxie anything to add to that?
Re-git
22:05@dockimbel I'm happy to know that it is being worked on.

qtxie
09:22@vejitatoja @dockimbel I pushed a PR for garbage collecting image!. We can also give action delete the ability to delete an image.
09:30Also we need some strategies to trigger the GC, as the image memory is allocate by the OS, we don't know how much it has been used.

GiuseppeChillemi
07:51Before I install it. Is VScode be able a build/show a list of user defined function using that extension?
bitbegin
08:23@GiuseppeChillemi yes
endo64
11:11attempt 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]
dockimbel
13:55@endo64 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...
13:57
lisp
>> attempt [a: 10 exit]
*** Script Error: invalid argument: [a: 10 exit]
*** Where: catch
*** Stack:  

>> probe :attempt
console
== console

Seems like it's corrupting the environment, so worth a ticket.
endo64
15:36Done. #3924
meijeru
21:19But see also #3362 !
GiuseppeChillemi
22:06@bitbegin when I insert my path to the red toolchan all the \ disappear and path elements are joined.
22:08my path is...
E:\_Drives\_DropBox Giuseppe Chillemi\Dropbox\Svi\prj-LearnRED
It is translated to
22:09E:DrivesDropBox Giuseppe Chillemiropboxvirj-LearnRED
dander
22:24@GiuseppeChillemi if you are editing the settings.json directly, you need to use \\
dockimbel
22:30@meijeru Looks like the same bug.
GiuseppeChillemi
22:44@dander "The active file is not a Red or Red/System source file" when hitting F6
22:46
Red [

]

myprint: func [arg] [print arg]
myprint arg


Filename is VSCodeTry.r
22:47Settings.json is:
{
    "red.redPath": "E\\_Drives\\_DropBox Giuseppe Chillemi\\Dropbox\\Svi\\prj-LearnRED",
    "red.buildDir": "E:\\_Drives\\_DropBox Giuseppe Chillemi\\Dropbox\\Svi\\prj-LearnRED"
}

endo64
23:37@meijeru Thanks!

bitbegin
01:51@GiuseppeChillemi the file with extension *.red will be treated as Red file, if you want *.r as Red file, please select language mode to Red
dander
03:17@GiuseppeChillemi I think redPath also should include the red.exe, and it looks like you are missing the colon on the drive letter
GiuseppeChillemi
09:00@bitbegin saved as *.red , no results. also added red.exe, still no results.

bitbegin
09:35[![image.png](https://files.gitter.im/red/bugs/1LKy/thumb/image.png)](https://files.gitter.im/red/bugs/1LKy/image.png)
09:35[![image.png](https://files.gitter.im/red/bugs/jELL/thumb/image.png)](https://files.gitter.im/red/bugs/jELL/image.png)
09:35@GiuseppeChillemi
GiuseppeChillemi
11:03@bitbegin
Here is the actual config file (note, the system inserts uses --cli by itself)

{
    "red.redPath": "E:\\_Drives\\_DropBox Giuseppe Chillemi\\Dropbox\\Svi\\prj-LearnRED\\Red.exe",
    "red.buildDir": "E:\\_Drives\\_DropBox Giuseppe Chillemi\\Dropbox\\Svi\\prj-LearnRED\\"
}


Here is the consolle output

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 : CommandNotFoundException


Please look at this:

ObjectNotFound: (E:\_Drives\_DropBox:String)

The path has been truncated at the first space.
rebolek
11:04@GiuseppeChillemi don't you need to escape spaces as well?
bitbegin
11:06@GiuseppeChillemi you can change the "\\\\" to "/"
rebolek
11:07try something like E:\\_Drives\\_DropBox\ Giuseppe\ Chillemi\\Dropbox\\Svi\\prj-LearnRED\\Red.exe or how does the escaping work there.
GiuseppeChillemi
11:09@rebolek I do not know how to escape them in this situation as I supposed standard DOS rules were in place.
11:10Also it seems I have to close and reopen VSStudio to accept corrections when there were errors.
rebolek
11:12@GiuseppeChillemi so try \and see what happens
GiuseppeChillemi
11:17E:\_Drives\_DropBoxspace>Giuseppespace>Chillemi\Dropbox\Svi\prj-LearnRED\
11:18GiuseppeSpace, my new internet alias !
rebolek
11:19:D I meant backslash followed by space instead of just a space and certainly not , it's just that Gitter strips space from code
11:19see my first example
GiuseppeChillemi
11:19MEGALOL !!!!!
bitbegin
11:21E:/_Drives/_DropBox Giuseppe Chillemi/Dropbox/Svi/prj-LearnRED should be ok
GiuseppeChillemi
11:22I have already tried backslash followed by space so I thought \ was another solution !
rebolek
11:23Ah, I see :)
9214
11:26
text
E:\\_Drives\\_DropBox%20Giuseppe%20Chillemi\\Dropbox\\Svi\\prj-LearnRED\\Red.exe
GiuseppeChillemi
11:26@bitbegin It didn't work
11:26@9214 trying
11:38@9214
{
    "red.redPath": "E:\\_Drives\\_DropBox%20Giuseppe%20Chillemi\\Dropbox\\Svi\\prj-LearnRED\\Red.exe",
    "red.buildDir": "E:\\_Drives\\_DropBox%20Giuseppe%20Chillemi\\Dropbox\\Svi\\prj-LearnRED\\"
}


Command not recognized as cmdlet...

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 : CommandNotFoundException



rebolek
11:39Windows ¯\\_(ツ)__/¯
GiuseppeChillemi
11:39It has been much easier the first time I built the console from sources !
11:39@rebolek your modifications made a nice animation here !
rebolek
GiuseppeChillemi
11:49Just a note: if you edit the JSON config the path is above the toolchain, in the GUI it is below. Moving back and forth confuses the mind which expect to see it on the just used position.
11:51Ok, forget about my message
11:51It's not fixed.
11:52I can revert and nothing changes the order (but I will close and oopen VSTudio to be sure)
9214
11:56People who use spaces in file paths usually ask for trouble.
11:59
text
'E:\\_Drives\\_DropBox Giuseppe Chillemi\\Dropbox\\Svi\\prj-LearnRED\\Red.exe'

Or try the same but with double quotes, or use backtick for escaping.
E:\\_Drives\\_DropBox` Giuseppe` Chillemi\\Dropbox\\Svi\\prj-LearnRED\\Red.exe
GiuseppeChillemi
12:01@9214 It's 2019 not 1989, we can't ask people to not use spaces in paths. It's better we are discovering this problem right now that when we will have wider audience
rebolek
12:01@GiuseppeChillemi this has nothing to do with Red.
GiuseppeChillemi
12:02@rebolek I supposed there were some problem with the extension...
12:02That was my subject and not Red itself
9214
12:02@GiuseppeChillemi this is solely your problem, not Red's or VSCode plugin. Why you're using /bugs room to solve it is beyond my understanding.
rebolek
12:03Ok. But the extension itself depends on VS Code, Windows and so on on path handling.
GiuseppeChillemi
12:06@9214 beacuse we are analyzing a problem and later qualify it to be a bug or not. A thing which has always been done here in this manner.
rebolek
12:07@GiuseppeChillemi He means that this room is for Red bugs and not for VSCode problems with spaces in paths.
12:08Which is unrelated to Red and I expect other extensions to have same problem.
GiuseppeChillemi
12:17@rebolek I know but I have seen a discussion about a BUG in VSCode red extension just before mine.. It triggered my curiosity for such work to have a better coding enviromnent.. so I downloaded it and discovered the extension was not able correctly handle paths (and you think it is the extension because the bug happen under the configuration file you think the extension controls)... so I am back to the room where I have seen discussing a bug about the VSCode red extension !
Feel free to point me the proper discussion room and I'll move there.
rebolek
12:19@GiuseppeChillemi Such is room is certainly not on Red's Gitter. I'm not sure where VSCode discussions are taking place, sorry.
GiuseppeChillemi
12:34@rebolek Just a question before leaving: if main RED site talks about the Extension, you see "Full Stack Technology" signature on it, you open the config file from the inside of the extension and you have just seen people talking about a potential VSCode extension problem here. Don't you think that anyone would do the same ?
Ok, Now I can move.
rebolek
12:37@GiuseppeChillemi There may (and probably are) bugs in Red VSC extension. It's certainly right place to discuss them here. However how should be path with spaces properly escaped on Windows version VSC using PowerShell is different problem.
12:39If I copy Red to directory with spaces on Linux and then not properly escape them, so I can't run Red exe, is it Red problem? I believe it itsn't.
[~] 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
bitbegin
12:42i will have some time to fix it
GiuseppeChillemi
12:49@rebolek We are discussing about mind mechanism here and I should answer with another question: I have associated the config file under direct control of the extension. Why it happened ?
(Why don't we continue to chit-chat , I have pleasure to introduce some psychological topics that could be really interesting !)
rebolek
12:49Let's move there, we are off-topic, right.
GiuseppeChillemi
13:13@bitbegin thanks, I have opened an issue here: https://github.com/red/VScode-extension/issues/35

endo64
11:46@rebolek @hiiamboris
I raised an issue #3927 as for the discussion here https://gitter.im/red/parse?at=5d1485adf040bc5fb6d4750e
rebolek
12:06@endo64 thanks

abdllhygt
21:17
Red
>> "i" = "ı"
== true
>> "o" = "ö"
== false

is it a bug?
greggirwin
22:07@PeterWAWood is our unicode comparison expert, but maybe someone else can chime in with information. Or search for the subject in general, on the net, and post your findings.
abdllhygt
22:41maybe it's about Turkish;
Turkish i İ,ı I
English i I

PeterWAWood
00:22@abdllhygt Red's Unicode support does yet not include locale processing so cannot correctly compare the Turkish i characters.. At the moment, Red's unicode support is basic. I wrote a paper on Unicode support. It was in the wiki but it seems to have been removed. It explained the major features needed for proper Unicode support (rather than support of Unicode-encoded text). There was the intent to either include better Unicode support in Red or in a standard module. That was a few years back and I'm not sure if Unicode support is still planned.
01:34I found the wiki page - https://github.com/red/red/wiki/%5BPROP%5D-Unicode-Issues-with-Proposed-Resolutions

It was written well before @dockimbel requested the Red Enhancement Process. Ideally somebody would convert it to a Red Enhancement Proposal (REP).


01:35The "Unicode Out-of-the-Box Tests" are no longer actively maintained. If somebody does convert the wiki page to a REP, it would probably be best to remove the reference to them.
01:39As the paper is more than 5 years old, it really should be reviewed against changes in the Unicode standards themselves.
abdllhygt
11:04@PeterWAWood thank you
endo64
14:23
>> uppercase "ı"
== "I"
>> uppercase "i"
== "I"
>> uppercase "o"
== "O"
>> uppercase "ö"
== "Ö"
greggirwin
17:21Thanks Peter!

toomasv
11:33on-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:

Without ctrl:
view [base on-wheel [print [event/ctrl? event/picked]]]
true -1.0   ;down
false 1.0   ;up


With ctrl:
true -1.0    ;down
true 2236963.133333333   ;up


Tried with latest build on W10. Does anyone confirm?
11:43Also, 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
14:48More:
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

qtxie
08:00@toomasv A regression? Does it work before?
toomasv
08:04@qtxie Yes, here are results from May 21 build:
>> 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

But on-over acted the same way as now.

toomasv
05:38@qtxie Thanks! Everything OK now.
qtxie
13:19@toomasv You're welcome. :smile:

Softknobs
21:00Hi, I am compiling the same code for both Windows and MacOS and the #call statement is only working in the windows version. This looks like a bug to me but I might be wrong.
I have created a gist with a simple example I can't get to work on MacOS: https://gist.github.com/Softknobs/0c3b2c144db014b12dcd84f73ec9d3fb
Thanks

dockimbel
09:49@qtxie ^---
qtxie
10:15@Softknobs Please use -t Darwin instead of -t macOS when you need to output to the terminal.
greggirwin
15:58Do we have that noted somewhere?
endo64
21:10It is on red --help
Cross-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 bundles
21:14Though it might be better to put a note "use console targets when you need to output to the terminal" on https://github.com/dockimbel/Red/blob/master/README.md file.
greggirwin
22:32:+1:

Softknobs
22:07@qtxie Thanks for pointing this out. However, this behaviour still looks like a bug or at least inconsistent. print 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).

qtxie
05:18@Softknobs If it works with -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.
Softknobs
14:37@qtxie I can't seem to reproduce the behaviour on Windows, maybe I messed up at some point and used the default MSDOS behaviour. Running a GUI macOS application from inside the app bundle shows a terminal window even if it's a GUI only application. Messages written to the console are written there for application done in other languages (ex: Java). This is handy for debugging and it can be misleading when not all printcommands are shown. That's just my opinion.
14:58@qtxie Still, the 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.
qtxie
18:41@Softknobs Did you set the area field in R/S? If so, you need to refresh the area manually.

Softknobs
20:40@qtxie I can't acces the field in R/S, however some R/S code (callback) triggers Red code to update the area. How do I refresh the area manually, I can't see this possibility in the area documentation
qtxie
21:18@Softknobs Try show area-face.

endo64
11:37When I close a modal windows, the main window lost the focus:
view [button "Open Modal" 200 [view/flags [button 200 "Close Modal" [unview]] [modal] ] ]
Can someone test & confirm please? I tested on Win10 x64, Red 0.6.4 for Windows built 16-Jul-2019/18:28:15+03:00 commit #66ba8c8
toomasv
11:47@endo64 Confirmed, on closing the modal, main window is lost beind other windows. My build is from July 15th.
endo64
13:12Thanks @toomasv
@qtxie Worth a ticket?
toomasv
13:20@endo64 You are welcome! Work-around is to set focus explicitly, e.g.
view [button "Open Modal" 200 [view/flags [button 200 "Close Modal" [unview]] [modal]  set-focus face] ]
endo64
13:45Thanks @toomasv , interesting that was the first thing I tried but didn't work for me.
13:50Your workaround works, I think there was another problem on my test. But it wasn't like this before, right?
qtxie
13:54@endo64 Yes, please open a ticket.
toomasv
14:03@endo64 Yes, I tried with build from May 21st, and there was no such problem.
endo64
14:14@toomasv @qtxie Thanks, issue raised, https://github.com/red/red/issues/3942
qtxie
14:22@endo64 Thanks! :ok_hand:

hiiamboris
11:11Hi! I notice that simple macros do not work anymore:
Red []
#macro [path!] function [s e] [print ["ATE" s/1] []]
invalid/path

Gives me (with --cli option):
*** Script Error: invalid has no value
Instead of:
ATE invalid/path
11:12Was there some change in macro system or do you think this has been broken by the parse modifications?
11:12Red 0.6.4 for Windows built 23-Jul-2019/22:51:39+03:00 commit #613d71c
greggirwin
13:45Seems OK here.
Compiling 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

Same for release compile.
13:48Just did a pull, and still OK.

hiiamboris
12:08no, don't compile, just run the script, or *do* it
12:09same error on Red 0.6.4 for Windows built 27-Jul-2019/1:58:18+03:00 commit #6890912
abdllhygt
13:11
>> a: [adjective: false]
== [adjective: false]
>> a/adjective
== false
>> if a/adjective [print 1]
1
13:12is this a bug?
nedzadarek
13:16@abdllhygt no, because false is a word! not a logic! (true/false) value.
a: compose [adjective: (false)] ; == [adjective: false]
if a/adjective [print 1] ; == none
abdllhygt
13:19@nedzadarek thank you again
endo64
13:40@abdllhygt Or you can use the literal form of the logic values:
>> b: [x: #[false]]
== [x: false]
>> type? b/x
== logic!
abdllhygt
13:43@endo64 thanks
greggirwin
17:06@hiiamboris I did that first, but get the same result with console going back a year, so I don't think anything has changed. Do you have a specific build that shows the behavior you expect?
hiiamboris
18:32@greggirwin yes, builds from June 1st and earlier are OK
18:35(I don't have any builds between June 1st and July 23)
18:38@nedzadarek you're on W8 too, right? can you test :point_up: [July 27, 2019 2:11 PM](https://gitter.im/red/bugs?at=5d3c316c8aab922429ccc272) ?
greggirwin
18:40I'm on Win10.
nedzadarek
18:41@hiiamboris I'm on win 8.1 but let me check download/compile the newer Red.
greggirwin
18:43Ah, I was pasting into old consoles, duh. Duped here now.
hiiamboris
18:44Ok, I'll report it
greggirwin
18:48OK for me through 01-Jul, but fails on 22-Jul build.
hiiamboris
18:54Thanks. Reported it https://github.com/red/red/issues/3951
nedzadarek
19:11@hiiamboris seems fine:
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
hiiamboris
19:12it compiles fine for me too
19:138731 ms - that's some incredible CPU :)
nedzadarek
19:13@hiiamboris was I suppose to run with -c?
hiiamboris
19:13@nedzadarek no, just red --cli script.red
nedzadarek
19:17@hiiamboris low end laptop... but it seems run some basic things too slow - I wonder why.
*** Script Error: invalid has no value
*** Where: catch
*** Stack:

then I can confirm
hiiamboris
19:19@nedzadarek thanks
nedzadarek
19:19:+1:

ralfwenske
05:04On OSX the following makes the progessbar jump to 100% at the end of the repeat loop:
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]
]

It works when uncommenting the loop statement
05:15As @rcqls pointed out: loop 3 is not necessary

toomasv
07:32On recent builds event/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)
hiiamboris
08:12I disagree with @bitbegin closing #2503 and #3336. Please reopen these.
bitbegin
08:14[![image.png](https://files.gitter.im/red/bugs/Wwxg/thumb/image.png)](https://files.gitter.im/red/bugs/Wwxg/image.png)
08:14[![image.png](https://files.gitter.im/red/bugs/91yV/thumb/image.png)](https://files.gitter.im/red/bugs/91yV/image.png)
hiiamboris
08:16Oh come on man, read the description and comments :) By closing an issue you do not solve it.
Softknobs
20:17I have this problem that looks like a bug in the following script:
https://gist.github.com/Softknobs/7b4c48fc16705e5dad2d2c6e297465ff
Depending on how the script is run, the first "obj1/inputs/1/open" is not run and thus the message "Open" is not printed nor the file written to disk.
- do <script name> will print "Open" once and then everytime the button "open" is clicked
- running the script from the console does the same
- compiling the script with -c un running the executable does not show the first "Open" message. Only when the button "Open" is clicked.
Am I missing something? Thanks.
greggirwin
20:37@Softknobs see if you can find an existing ticket for this behavior. It has to do with the function being in a nested object. There are known issues there. A global function works, o/oo/fn does nothing it seems, and (I think this is the known issue) o/fn crashes.

You can work around this by compiling in encap mode (-e) or using do [obj1/inputs/1/open].
23:29Can someone confirm @toomasv's :point_up: [July 30, 2019 1:32 AM](https://gitter.im/red/bugs?at=5d3ff278c356af25e0537dd4) note, and make sure @qtxie knows, creating a ticket if necessary.
23:58@Softknobs maybe https://github.com/red/red/issues/2975

dander
00:11@greggirwin I see shift? and control? set for all arrow directions, but no events when I'm pressing alt (maybe a Windows thing?)
00:12using https://gitter.im/red/help?at=5b57253ff477e4664abba883
ralfwenske
00:39@dander On OSX I see it under flags when it’s down: flags: altand key shows eg .d or
toomasv
03:16This is what I get with any combination of 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
ralfwenske
03:20OSX:
>> view [base on-down [print [event/ctrl? event/shift?]]]
true false
false true
true true
toomasv
03:23Thanks, @ralfwenske, so it is W only, or may be W10 only, or may be me only...
greggirwin
03:26I get the same results on Win10 @toomasv.
03:26Seems worth a ticket.
ralfwenske
03:31As @dander asked for arrow key I checked arrow down and all combinations show correctly:
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
toomasv
03:35https://github.com/red/red/issues/3955
03:44Right! Neither do any on-key events work.
ralfwenske
04:14Pasting following into console:
Red []
#macro dynh: func [height][
    rejoin ["panel react [face/size: as-pair face/parent/size/x " height "  ]"]
]
print [ dynh 300 ]

results in:
>> 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  ]
>>

strangely when I Run Current Script in Visual Studio (OSX) I get
*** Script Error: dynh has no value
*** Where: print
*** Stack:

is this a bug?
04:25In console:
>> 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

in Visual Studio terminal:
>> 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

Restarting VS makes no difference.
Compiling in VS is possible and the executable works as expected.
05:41I read a bit more about the preprocessor and now think that it’s not a bug and more related to how the preprocessor is designed to work. I need to play with it more to gather better understanding...
greggirwin
05:48Macros can be tricky beasts, and should be a last resort IMO. What is the ultimate goal?
ralfwenske
06:17Nostalgie? :) Nearly 50 years ago I developed a high level language based on 370 Assembler macros which increased productivity in that department dramatically ….those were the days.
I come to realise macros in Red are a bit different - and as Nenad pointed out we have so many other options.
I am experimenting with generating views as the guinea pigs.
endo64
07:23Is there a regression?
d:\red.exe -e test.red
>> *** Access Error: cannot open: %-e

Same for -s, -v, -d but -c, -r works.
07:24I'm on Win10.
9214
08:34@ralfwenske you don't need macros for that.
08:57@endo64 these flags are supposed to be used either with -c or -r.

nulldatamap
07:42Hey, I'm encountering an access violation on MacOS for the following code (I've reduced it as much as I could):
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: A6C1CF13h
07:44(Clicking on the panel results in the crash)
9214
11:11@nulldatamap can you please check it with [latest build](https://static.red-lang.org/dl/auto/mac/red-latest)?
nulldatamap
13:00@9214 I get the exact same error on both master and the build you linked
9214
13:10:point_up: can anyone else confirm that?
rcqls
13:45@9214 @nulldatamap Confirmed! (And not on Linux/GTK)
9214
13:46@rcqls thanks. In such case it warrants a ticket.
nulldatamap
13:47@9214 I'll file one then
9214
14:01@nulldatamap good job!
dsunanda
20:39REMOVE-EACH not consistent with REMOVE - or with R2's behavior. Bug, oversight, or careful design decision?
20:39
length?  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: == 2
meijeru
20:44This was noted and discussed already (see issues #2126 and #2366).
9214
21:00Some iterators return unset because a final design decision on their return values hasn't been made yet.
dsunanda
21:27Thanks guys - I did look for it on Github, but obviously ineffectively. I'd support Gregg's comments on #2126 - the R2 way is more consistent, and allows operations to be chained.

I found the problem when trying to debug this error: "split does not allow unset! for its series argument. Where: split" in some R2 code I was trying to convert to Red.
Given the code had around 50 PARSE/ALL converted to SPLIT, the offending line of code took a while to track down:
split remove-each str "A B C" [str = #"B"] " "

greggirwin
01:38There's another option we could try as well. Return both the modified series *and* the removed count. We do want to be careful about heading down that slippery slope, but then you only need to know how it behaves, and use it consistently with set [series count] remove-each ... if you need the results.

In the bigger scheme of things, that might affect the overall HOF design from a consistency standpoint.
01:47The series itself is the much more useful value, if we pick just one. For those who really need the functionality I just posted, it's a simple mezz.
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]
01:50Comments added to ticket.
01:52It's always a balancing act, between *potentially* useful things, and *commonly* useful things, weighed against adding too much stuff, making everything harder to use correctly. Include enough rich functionality that you don't *need* a lot of external bits, as with JS, but not so many that the built-in features are overwhelming and confusing.

planetsizecpu
18:04Hi folks, last days I found the Red console to crash if 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]]

Did it deserve a ticket?
greggirwin
18:09@planetsizecpu duped here on Win10. Yes, please file a ticket.
planetsizecpu
18:11@greggirwin Ok thx!

endo64
12:54I remember I already provided a solution to this issue (using throw) but Doc said we need a proper function attributes.

hiiamboris
21:03@dockimbel I believe https://github.com/red/red/issues/3805 deserves some more of your attention :)

corona-nova
03:48red does not take into account [sRGB](https://en.wikipedia.org/wiki/SRGB#The_sRGB_transfer_function_(%22gamma%22))'s nonlinearity @ [libred-and-macros](https://www.red-lang.org/2017/03/062-libred-and-macros.html)

should i file an issue?, it affects color gradients and anti-aliasing and transparency,

it basically means that (1.0/2)≠0.5 when @ sRGB thus maths that don't compensate for that don't work as intended
04:07[![complex-pen.gif.1.png](https://files.gitter.im/red/bugs/1zKs/thumb/complex-pen.gif.1.png)](https://files.gitter.im/red/bugs/1zKs/complex-pen.gif.1.png)
04:09above: math done in gamma-space (not compensating for gamma)
below: mockup interpreting as linear RGB and changing it to sRGB
04:09[![0001.png](https://files.gitter.im/red/bugs/RU7o/thumb/0001.png)](https://files.gitter.im/red/bugs/RU7o/0001.png)
gamma-corrected (done in linear space)
04:10notice that lines at diagonal points are darker if
it does not compensate for this
04:10[![complex-pen.gif.4.png](https://files.gitter.im/red/bugs/avlo/thumb/complex-pen.gif.4.png)](https://files.gitter.im/red/bugs/avlo/complex-pen.gif.4.png)
04:12color gradients look bad if not dealt with;
is this easy to implement, is the slight slowdown too much,
it affects aesthetics, should this [option] be default

affects image up/down-scaling, text-rendering also
04:13[![0004.png](https://files.gitter.im/red/bugs/5uv9/thumb/0004.png)](https://files.gitter.im/red/bugs/5uv9/0004.png)
color gradients looks more natural esp the yellows here
04:16those are only mockups, when implemented, it should apply inverse also on the other side of whatever math operation to keep color-endpoints the same
greggirwin
05:32@qtxie :point_up:
loziniak
11:25copy/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:
9214
13:36@loziniak this applies to image! values only.
loziniak
15:08Not a word about it in documentation...
greggirwin
16:33@gltewalt :point_up:. Though, as will be the case with many things, because documentation is hard, especially as things change, people need to apply some common sense when things don't work as they expect. This is a general rule that we need to encourage, while bodies of knowledge develop over time, for details like this.

In the grand scheme, the question is whether we can and should lock everything down in these early releases. If we leave things open a bit, as we have to with doc strings, it gives us room to change things. That is, if it isn't written down as a final behavior for the language somewhere, it could change. Being up front about that is no different than for any other language.
qtxie
17:14@corona-nova You mean the color of the gradient is not correct? Does the web browser draw it correctly? Red just uses the OS API to draw the gradients, I don't think it's easy to change it. You can open an issue on github with the code to reproduce it.
loziniak
20:03@greggirwin It reminds me a little a programming environment of Windows, with lots of undocumented behaviors, which, when used by developers, locks a language in some way anyway. Not to mention the problems it brings to projects like Wine, where people struggle to mimic these behaviors by trial and error to make software work on their platform.
20:07Changing doc strings along the code is not that hard I think. And even when some missing behavior is left in docs, this situation is not worse than being confused by undocumented quirks. What changes is just a source of confusion :-)
9214
20:44@loziniak Red's design is based on highly polymorphic functions, in which number of all possible argument combinations is fairly large (not to mention that concrete datatypes are abstracted away by typesets); so, documenting each of them case-by-case in docstrings is a flawed approach, which narrows our design space and pollutes function's spec. I second @greggirwin's response WRT common sense - it's rather easy to apply, since language is built on top of orthogonal features, which work consistently across the board.

You can help @gltewalt by extending [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.
loziniak
22:27@9214 thanks, I thought about it. The fact that 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.
greggirwin
23:55And this is where an example is worth a thousand words.

nulldatamap
13:06Looks like there's a buffer overflow bug in at least 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 garbage
13:07With red-09aug19-8a9920e6 on MacOS X
9214
13:08[decompress 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.
nulldatamap
13:13Same behavior on master (ccfff52)
qtxie
17:53@nulldatamap IIRC. You need to provide the exact size of the uncompressed data when use the /zlib refinement.
9214
18:06@qtxie which is at times not trivial at all, and requires passing of size together with compressed 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).
greggirwin
18:08If it has to be exact, and can cause a buffer overflow, that's a problem. The wrapper should either ensure no buffer overflow occurs, based on dst size, or this feature should not be available for general use.
9214
18:10@greggirwin agreed, current interface goes against the grain of Red's user-friendliness.
greggirwin
18:11@9214 if we trigger an error rather than overflowing, it should work with your multishot suggestion from red/welcome.
18:12From what @nulldatamap says they're doing, it sounds like this feature is genuinely needed in some cases. And having a PDF parser will be *very* cool. We might even be able to sponsor some of that work.
9214
18:13@greggirwin yes, but that's not an optimal solution. Perhaps we can pre-allocate sufficiently large (but how much is enough, exactly?) buffer for decompression, but yet again it's a memory penalty.
greggirwin
18:13The trouble with not knowing is... ;^\
18:14That is, if there are unknowns, it can't be optimal. ;^)
9214
18:15OTOH, I'm pretty sure PDF should embed metainfo about compressed stream size, or chunk data into fixed-size blocks.
greggirwin
18:15You would think. Because *they* want it to be optimal too.
qtxie
20:40I'm not familiar with the code, but it should be not difficult to add some checking code and throw an error. It's not intended to be used alone. That is, the compressed data usually come from some well-defined data. PNG, PDF, for example. In that case, you know the size of the uncompressed data.
greggirwin
23:18@nulldatamap is the uncompressed size stored in the PDF?

nulldatamap
07:35@greggirwin It is not, it's not mandated by spec, and there isn't a field for specifying it defined in the spec (PDF 1.7, 7.4.4.3: https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf#G6.1709041), so no
07:43Looking at PDFs in the wild I can't find any uncompressed size hints either
07:55Here's a compressed object stream from a PDF generated by pdflatex for example:
07:55
5 0 obj
<<
/Type /ObjStm
/N 7
/First 40
/Length 489       
/Filter /FlateDecode
>>
stream
... 489 bytes of compressed data ...
endstream
endobj
08:00/Length is the compressed length
qtxie
11:45@nulldatamap Do you know why the PDF generator use zlib format instead of gzip format which contains data's original size? They both use deflate algorithm, just that more meta info in the gzip format.
nulldatamap
14:20@qtxie I don't know why the spec doesn't use gzip, but it only supplies the FlateDecode filter which is zlib/deflate but no gzip alternative

Oldes
19:23I guess that the reason is that it was designed for streaming where the size of all uncompressed data is not important.
rgchris
22:05Red seems to want to output "^[[6n" on every session—is this a bug? I have a Red script:
Red [] prin <hello>

When I call it from Rebol, I get the following:
>> call/wait/output "red script.red" out: ""
>> probe out
== "^[[6n<hello>"
22:05
lisp
>> about
Red 0.6.4 for macOS built 25-Aug-2019/16:43:49-04:00 commit #a87243c

Oldes
09:44^[[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.
09:47I was asking for better ANSI escape sequences support years ago :) Function for removing these from string would be one of them.
rgchris
13:16@Oldes I don't generally use consoles, have never used the GUI console. I usually run as shell scripts.
greggirwin
21:56@bitbegin @qtxie ? :point_up:

bitbegin
03:16I can reproduce it
greggirwin
03:57Great! Thanks @bitbegin.
qtxie
04:16It's an old issue on non-windows system. I remember there is a ticket about it.
greggirwin
05:51So is it a bug or a design issue to review?
qtxie
06:48It's a bug. https://github.com/red/red/issues/1186
bitbegin
06:57https://github.com/red/red/pull/4009

GiuseppeChillemi
06:00I have issue the following command in the console:

probe read http://www.repubblica.it

After its output the consolle starts running very slowly. Try typing some characters and you will discover what I say. It happens always.
06:23*issued
Softknobs
09:10Hi, is this a bug? When I embed #system code in a Red function I get compilation error on non declared values (here cpt):
Red []

red-fun: function [][
	#system [		

		f: function [][		
			print-line "doing something"
		]		
		cpt: 0		
		f
	]
]

I get the error:
*** Compilation Error: variable cpt not declared
*** in file: %/C/ProgramData/Red/test-guard.red
*** in function: exec/f_red-fun

The same code works outside the red-fun function.
9214
10:20@Softknobs that's expected IIRC, #system should be declared at top level. Use routine!s instead.
Softknobs
10:41@9214 Thanks. If that is the case, in my opinion, the compiler should tell that #system is used incorrectly. Because if I remove the cpt declaration, the code compiles and works if I run red-fun function. This kind of "partial support" is misleading.
dockimbel
14:14@Softknobs You can embed #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
]

So, the compiler complaining about 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.

If you move the 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.
Softknobs
14:45I didn't realise the #system was converted to a function... Given that, adding one level of nesting solves (well, not in a elegant way) the problem:
Red []

red-fun: function [][
    #system [        

		f1: function [/local cpt][
			f: function [][        
				print-line "doing something"			
			]        
			cpt: 0        
			f
		]
		
		f1
    ]
]

red-fun

To be honest, doing this code was not my initial intent: I was trying to reproduce another problem moving different code parts (with more Red code around it) in my script in order to reproduce another problem. I stumbled upon this peculiarity and thought it was worth mentionning it here... Thank you Nenad for taking the time to explain the behaviour.
greggirwin
18:12@Softknobs would you be so kind as to extract those few messages, including Nenad's and your solution, and add them to https://github.com/red/red/wiki/%5BNOTES%5D-Red-System-Notes? Thanks!
dockimbel
20:59@Softknobs
> I didn't realise the #system was converted to a function...

That is not what I said. I said: In 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).
21:03The proper way to write that code would be:
Red []

#system [
	f: function [][
		print-line "doing something"
	]
	cpt: 0
]
red-fun: function [][
    #system [f]
]
Softknobs
22:35@greggirwin Added the discussion to the [Red System Notes](https://github.com/red/red/wiki/%5BNOTES%5D-Red-System-Notes) wiki page
@dockimbel My bad, thanks for the clarification and the example.
greggirwin
23:20:+1:

Softknobs
21:38Hi, I am getting the following error:
*** Runtime Error 21: guard page
*** at: 0FAEBCFBh
[In this script](https://gist.github.com/Softknobs/7c738f01e8a01463c5acf9467524333b)
Has anyone already experienced such error? I give the code as example but I don't know if the script is of any help since it requires external hardware to work.
Basically it does the following:
* defines a R/S 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]
The problem then occurs in the 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]

However, there is no crash if I replace the above code with:
append model/binary-midi-messages message

What is weird is that the number of processed messages before crash is not the same depending on the operations done in new-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)
This looks like a bug to me, anyway any workaround would be appreciated.
Sorry if my description of the problem is not clear but what I am trying to achieve is not trivial either... Thanks.

9214
09:12@Softknobs can you check your script with garbage collector turned off (put recycle/off at the very beginning)?
09:14To get more details, compile script in debug mode (-r -d flags). And, of course, make sure you check all of that with latest build.
dockimbel
11:12@Softknobs A stack trace would be helpful to identify the cause. @rebolek could you have a look at that code if you have time?
rebolek
11:15@dockimbel @Softknobs no problem, will do. It looks very interesting!
Softknobs
20:53@9214 Thanks for the hints.
I tried recycle/off, same error.
I also tried the 31.08.2019 build two days ago with a slightly different version of the script, and the error also occurred.
With the -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

@dockimbel Is the above text the stack trace you were talking about? I am used to Java stack traces so it looks small to me...
@rebolek Thanks, it is nice to know you find it interesting :)
9214
23:48@Softknobs thanks! :+1:

DVL333
10:57Hi there!
Is it a known bug? to-image or to image! doesn't convert the layout to the image:
lay: layout [button "Hi there!"]
to image! lay
Oldes
11:11@DVL333 the face must be visible to be convertable to image. This works:
view/no-wait lay
img: to image! lay
unview lay
img ;== make image! [198x110 #{...
11:13It's not a bug... with layout you create just the _virtual structure_, which is converted to native widgets when you _view_ it. (if my english is understandable)
DVL333
11:15@Oldes Ok, i see, thanks.
Oldes
11:15You may want to place position of the window out of the user visible area to avoid being it visible for the short moment when it's being converted.
9214
11:47@Oldes IIRC there was/is a wish for taking screenshots of faces without rendering them, since R2 has that feature (if memory serves me well).
11:48Rendering them on the screen, that is.
Oldes
12:53@9214 but R2 is not using native widgets.
9214
13:00@Oldes indeed.
xqlab
13:20You can set the field visible? of your lay object to false before viewing
Oldes
15:04@xqlab If you do so, you will not get the proper content as a result as invisible content is not rendered.
15:07Better is to do: lay/offset: negate lay/size when you want to view it just to make an image from it.

xqlab
05:45True, I did not check the rendered image

rebolek
11:04I probably shouldn't see this error, when compiling pure Red (no R/S) code, right?
*** 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!]
    ]]
9214
11:39@rebolek looks like you found a missing as red-value! somewhere in runtime internals.
rebolek
11:40Yeah, somewhere...now to strip it down to a simple example :-)
GiuseppeChillemi
18:06On Window SERVER 2008R2 if I load a text in a view AREA the thumbnail which which rapresent the windows content retains the old aspect with empty text. I have to iconify and reopen to have the aspect updated. Still not tried on other platforms.
greggirwin
20:10Red can't control when Windows updates its thumbnail.
dockimbel
20:49@rebolek That's an uncommon error, looks like an edge case in Red compiler, missing a type casting or passing a wrong argument. You can try to get some clue about which code part caused that by inserting a 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.

rebolek
05:50@dockimbel thanks, I'll try that

meijeru
16:39The following is not a bug _per se_, but shows the pitfalls of using 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 probe

The error is to supply an _expression_ as argument to f 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.
9214
16:44I would think of extending spec dialect, so as to allow specify word's binding information (e.g. [word! (object!)] or somesuch.
meijeru
17:25It would not be too difficult to preprocess your syntactic proposal into assertions...
17:26On a related subject: this still gives an error while I thought it had been solved.
>> 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:

17:26It should give 3 in my opinion.
9214
17:31@meijeru see dependent types and @rebolek's [blog post](http://red.qyz.cz/dependent-types.html).

> this still gives an error while I thought it had been solved

What error are we talking about? Functions with quoted arguments, by their nature, take precedence over operators in such cases.
meijeru
17:41Yes but then 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).
9214
17:44> Yes but then f 1 + 2 should equal (f 1) + 2 or 3 shouldn't it, and not an error

That's not how evaluation semantics works. f eats 1 and + if left with dangling left side, which error message clearly indicates.
17:52Operators take value on the left and expression on the right. What you propose is that operators seek their left argument either on the left side or on evaluation stack.
greggirwin
18:25@9214 do you mean that [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.
18:26Lit-word args are a double-edged sword, to be sure.
9214
18:26@greggirwin "pass only words which are bound to an object! value".
18:27And further down the line you can describe precisely which object! you want to accept (class id, presence of specific fields, etc).
greggirwin
18:32Got it. Thanks.

loziniak
12:19Is there any reason why it's better to pass word to the functions like these instead of word's value?
9214
12:36@loziniak that way you can modify word's value in place, e.g. 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


and hypothetical 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
12:37Other than that it's just a syntactic sugar:
>> 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
loziniak
15:55Thanks!
greggirwin
18:52@loziniak in this case, for an object inspector, I wanted to include the name reference. Using the word let me do it with one param, but you could also pass the name and value as separate args.
18:54Using @9214's example, where the user has to know to pass a lit-word, is another way. If you then add typeset support for both words and objects (in my example case), you can do both.

Oldes
19:25mold/flat does not removes line breaks when used with binary! value:
>> mold/flat #{FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF}
== {#{^/FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF^/FFFF^/}}

Oldes
14:45@dockimbel regarding the comparison of two pairs, is this really the best result?
>> 1x6 < 2x2
== true
15:29Hm... I guess, that the recent change in pair comparison was to get this:
>> sort [1x2 1x1 2x1 2x2]
== [1x1 1x2 2x1 2x2]

Instead of this in Rebol:
>> sort [1x2 1x1 2x1 2x2]
== [1x1 2x1 1x2 2x2]
meijeru
18:44Yes it is now lexicographic: first on x, then on y.
greggirwin
21:03@Oldes :point_up: [September 24, 2019 1:25 PM](https://gitter.im/red/bugs?at=5d8a6db3ab4244767bfb0657) it looks like it matches R2, and the doc string for flat does only say "indentation". I have an old 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.

My gut reaction was that mold/flat should remove lines, but thinking a bit changed my mind.

I don't want to hijaak your question, but should trim/lines on a block remove new-line markers? That seems useful to me.
21:05That may be confusing, if it also removes none values. So we can just stick with new-line/all ... off.

hiiamboris
07:08I have modified the [code from the help room](https://gitter.im/red/help?at=5d8becfcbae2907f6c396669) a bit:
foo: function [][do [continue]]
forever [
    print "foo"
    foo
]

It compiles but gives this:
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

Worth a ticket? I get it that forever is compiled while continue is not. Still, weird error. In the lines of "magic bad" :)
endo64
07:23There is a small issue on 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 output

Can someone test & confirm? I'm on Win10. Latest build Red 0.6.4 for Windows built 25-Sep-2019/22:36:30+03:00 commit #f753e25
hiiamboris
07:27
>> prin "one^/two^/three"

one
twothree
>> prin "one^/two^/three^/"

one
two
three

W7. I recall seeing this issue when I was fixing the recursive print. It's a glitch in the GUI console code. Related to multi-line editing IIRC.
endo64
07:31Thanks for testing. I'll check if any related issue on Github. Extra newline in the beginning is not a big deal but the other issue could be annoying if you output to a file for example.
greggirwin
16:30@hiiamboris worth a ticket, because the explanation may be helpful for other behavior.
hiiamboris
16:52okay

avitkauskas
11:27transform with negative scale-y does not work on Mac OS:
view [box 100x100 draw [transform 0 1 -1 0x100 line 0x0 50x20]]

gives a blank screen, but that works:
view [box 100x100 draw [translate 0x100 scale 1 -1 line 0x0 50x20]]
qtxie
16:50@avitkauskas Fixed in the latest build.
greggirwin
16:52Looks like @hiiamboris did some testing on this, and we need to confirm if there are regressions.
hiiamboris
17:03Let me try it again...
17:22@qtxie doesn't seem to work: https://travis-ci.org/red/red/builds/590511277?utm_source=github_status&utm_medium=notification (but maybe it's a different issue)
qtxie
17:44@hiiamboris Yes. It's different issue.

avitkauskas
20:20@qtxie Yes, transform with negative scale-y works on Mac OS in the latest build. Thanks!

ralfwenske
09:35MacOS: hitting return several times in terminal ( or worse: holding it down a few seconds ) causes long delay until >> shows again.
09:35Red 0.6.4 for macOS built 28-Sep-2019/2:46:20+10:00 commit #d0e6692
avitkauskas
09:38It also happens if you just keep Red console open for a few minutes without doing anything.
hiiamboris
09:50@qtxie ^
qtxie
09:56Please open a ticket on Github, so we don't forget it.
ralfwenske
10:03#4058

rebolek
12:51copy/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
    )
)
13:03Hm, doesn't https://github.com/red/red/issues/2167
hiiamboris
13:30@rebolek see also https://github.com/red/red/issues/2254

hiiamboris
15:46Is this worth reporting?
>> load probe mold/all %"c:\file"
"%c:\file"
*** Syntax Error: invalid value at ":\file"
*** Where: do
*** Stack: load
15:47(considering that mold/all is with a permanent TBD flag)
greggirwin
15:56@hiiamboris what do you expect it to produce? %c:\file isn't valid.
9214
16:00@hiiamboris mold eats inner quotes for some reason.
hiiamboris
16:10@greggirwin it was valid until I molded it ☻
9214
16:15Worth a ticket, since mold [doesn't](https://github.com/red/red/blob/master/runtime/datatypes/file.reds#L163) handle quotations in any way.
greggirwin
16:20Ah, I see what you mean. R2 has the same limitation.
tpburke_twitter
16:27Hello all,
16:29Oops. I noticed this today:

>> about
Red 0.6.4 for Windows built 1-Oct-2019/18:41:56+02:00 commit #2976655
>> sort/compare [1 4 3 7] func [a b][a < b]
== [7 4 3 1]
>> sort/compare [1 4 3 7] func [a b][a > b]
== [1 3 4 7]
>>

Unless I really have been here too long, this is reversed.
hiiamboris
16:30@tpburke_twitter interestingly, this issue popped up just yesterday I think. It was fixed, although not on the master branch.
9214
16:30@tpburke_twitter https://github.com/red/red/issues/3768#issuecomment-537559253
tpburke_twitter
16:33@hiiamboris Thanks. I'll pick up the latest release.
9214
16:34@tpburke_twitter consider to re-read what we just posted for you - this fix is not on the master branch.
16:35Though, perhaps it should be cherry-picked (@dockimbel?)
dander
16:36Weird, I never knew you could quote a Windows-style path like that in a 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.
Is this the same thing too? Does the console just print the molded value when it evaluates it?
>> %"c:\file"
== %c:\file
greggirwin
16:37@hiiamboris @9214, let's think about the file issue. Quotes let you put anything in there, but Red knows it's a file and wants to make it loadable. Since you can create file values that aren't loadable, should Red work as is and normalize things in a simple way, or should it allow you to abuse files in this manner?
16:39It's very nice that it silently works for local files, but if you're going to serialize them, should we carry that over? My gut says No.
9214
16:40> Since you can create file values that aren't loadable

Example? For what it's worth, it counters all the garbage I put in with URL-style % normalization.
greggirwin
16:40%"::::::::::::"
16:42Note that R2 does not support local filenames directly in read.
9214
16:43I think the reason why %"..." 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.
greggirwin
16:48Email should not do that, and will change I expect. The user/host result is backwards.
16:51*Should* Red support this notational convenience though? That's my question. We have a file! form, and the convenience part is not for locality, but for special characters like spaces. Making users type %20 is not human friendly.
9214
16:55Functionally, %"..." is a shortcut for to-red-file "...", so...
>> %: :to-red-file ()
>> %"c:/file"
== %c:/file
>> % "c:/file"
== %/c/file
greggirwin
16:58I don't know that it's a shortcut by design.
9214
16:59The question is if 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.
greggirwin
16:59We need more info in https://doc.red-lang.org/en/datatypes/file.html, and can ping @gltewalt about doing that. http://www.rebol.com/r3/docs/datatypes/file.html can be a starting reference from an historical perspective.
9214
17:01And lexically %"..." is the same as to file! "...".
hiiamboris
17:11My opinion is that 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?
17:12And since %"" notation isn't likely to go anywhere, it should be supported by mold/all as well.
greggirwin
17:15Constraints are not a bad thing. Datatypes exist to provide constraints in meaning and understanding. Some are more flexible than others. At this moment, I think we benefit more from constraining file! than making it more flexible.

@hiiamboris, are you saying *all* file values should be quoted, rather than normalized? e.g. this would change?
>> %"/c/file"
== %/c/file
17:16Or that mold should sniff file! values and quote them accordingly when molded?
hiiamboris
17:39@greggirwin *sniff* right ☺. Quote when it's unloadable otherwise.
greggirwin
22:12Being able to save and load all state requires construction syntax or a binary equivalent.

To @9214's point about dialects, you can still abuse files this way, with a few characters being exceptions. e.g. :

>> %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.

> Functionally, %"..." is a shortcut for to-red-file "..."

I disagree @9214. The quoted format is part of the lexical form, and only the current behavior for some 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


@hiiamboris' problem is that we can't round-trip 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:

1. Do *not* sniff and always returns quoted format, not percent encoding
2. Sniff for Windows colon format and return quoted form {%"c:\file"}; otherwise use percent encoding
3. Sniff for *any* non-supported characters (currently defined by URL compatibility) and return quoted format, not percent encoding
4. Incorporate to-red-file logic to always produce %/c/file, with percent encoding
5. Incorporate to-red-file logic *and* sniff for any non-supported characters and return quoted format, not percent encoding

Quoted form is cleaner, clearer, and simpler than percent encoding *IF* you have special chars. We still need percent encoding for URLs, and Red could still load them, for Redbol compatibility, but that doesn't mean it has to produce them.

hiiamboris
09:21Wow I got these curious warnings "VIEW: WARNING: free null window handle!" and a silent crash afterwards. Gonna try to localize the issue...
09:59Can you guys try to paste this script into the console:
view [
    index: text-list 300x460
    on-alt-down [
        view/options
            [ text-list data ["a" "b"] ]
            [ actors: object [on-unfocus: func [f e] [unview/only f]] ]
    ]
]

On W7: After I *right-click* on the window, there appears another window. When I then *left-click* the main window to trigger an unfocus event, the event loop just stops, returning me to the console prompt. If your console is compiled with -d option, it will also show a VIEW: WARNING: free null window handle! line.
toomasv
13:27On somewhat dated (built 14-Sep-2019) console this doesn't happen on W10.
hiiamboris
13:34@toomasv thanks ☻
avitkauskas
14:11On Mac OS I see no errors. But it opens new small pop-up window every time you right-click. And when you close the main window, you have to close all small windows stacked on each other.

endo64
13:35No issue on Win10, but right click opens a window only for once, no stacked windows as @avitkauskas reported. It might be MacOS issue that on-unfoucs might not be triggered.
hiiamboris
15:43@endo64 no issue on W10 on the current build?
endo64
22:58@hiiamboris Nope, no issue on latest build on Win10, just tested on CLI and GUI console.
23:00I didn't compile, just pasted onto console. it returns me to console prompt when I click on the small window, not the mail window.
23:06Shouldn't last two raise error?
>> 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]
9214
23:09@endo64 R2 and R3 choke with "invalid decimal / pair" error, respectively.
endo64
23:11@9214 It's different for me, on R3 last one loads, Invalid tuple -- .0x.0 on R2.
R3> load ".0x.0"
== 0x0

R3> load ".1x.3"
== 0.10000000149011612x0.30000001192092896
9214
23:12@endo64 try load ".4x".
endo64
23:13For that one, yes, I get invalid decimal / pair error
greggirwin
23:15Things like this could be good to stuff in a quick list on a wiki page. With the fast lexer coming, we want to make sure we know of changes, which may not be testing against expected value formats.
endo64
23:42@greggirwin I've created a page: https://github.com/red/red/wiki/%5BNOTES%5D-Lexer-Notes
greggirwin
23:43:+1: Thanks!

hiiamboris
06:04@endo64 Yes, when I click on the small window it throws me into the console too. Well, that's exactly the problem - the event loop gets interrupted. Plus, I don't think it should trigger on-unfocus when you're clicking on the active window. Thanks for testing (:

P.S. Oh well, maybe it should... focus the text-list and unfocus the main window? What do you guys think? Is it reasonable that the main window stays active but gets an unfocus event?
DVL333
16:05Hi there!
Is it a bug?
obj: make reactor! [a: 3 b: 5 sum: is [a + b]]
set-quiet 'obj/a 5

Get an error set-quiet does not allow word! for its word argument.
hiiamboris
16:24@DVL333 set-quiet in obj 'a 5
16:25The error message could have been better, I agree :)
DVL333
16:30ok, thanks. :)
16:35But, in any case, it's very strange, because a construction set 'obj/a 5 works as expected.
16:37Why these similar functions work so different? The result is confusing.
hiiamboris
16:50Well, 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 ;)
16:52Question is, should 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.
greggirwin
18:42The first thing we should do is add doc strings and type checks to -set-quiet.

meijeru
11:38
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!]

Doc string and types are in place, I think. Though, the type spec of word is perhaps too broad?
hiiamboris
12:43
>> remainder 10 11.22.33
== 1.2.3
>> remainder 10 11x22
== 1x2
>> remainder 10 make vector! [11 22 33]
== make vector! [1 2 3]

This is an intentional result, judging from the code. Do you find it wrong too? (I expected 10.10.10, 10x10, vector [10 10 10])
12:48Perhaps the code was written for commutative operations only...
12:50Same:
>> divide 10 make vector! [11.0 22.0 33.0]
== make vector! [1.1 2.2 3.3]
9214
12:52As if the order of arguments is ignored.
hiiamboris
12:57Yep. float/do-math and integer/do-math just swap the args, regardless of commutativity.
12:57https://github.com/red/red/blob/master/runtime/datatypes/integer.reds#L237
ushakovs_gitlab
16:54I run this script:
f: view/options/no-wait [
    t: h5 red 80x20 "Not frozen more" 
] [options: [drag-on: 'down] flags: ['no-title]]

When it run there are error messages in the console appears:
*** Script Error: + does not allow logic! for its value2 argument
*** Where: +
*** Stack: ask do-events do-safe
*** Script Error: + does not allow logic! for its value2 argument
*** Where: +
*** Stack: ask do-events do-safe

But all other works properly.
Is it bug?
hiiamboris
17:10Yes. You should report it on the [issue tracker](https://github.com/red/red/issues/) ☺
17:11I'm seeing the same error messages as you do. On W7.
toomasv
17:19On W10 the error message is
*** Script Error: path face/state/4 is not valid for none! type
*** Where: drag-offset
*** Stack: view show do-safe

But normal way works:
f: view/options/flags/no-wait [
        t: h5 red 80x20 "Not frozen more" 
] [drag-on: 'down] 'no-title
ushakovs_gitlab
17:25[drag-on: 'down] doesn't set options/drag-on to 'down
So window became unmovable.
As one say to me - right way to set options is [options: [drag-on: 'down]] and this is really works! But show errors...
greggirwin
18:34@meijeru compare doc strings and types for set and set-quiet. The latter is even more restrictive, and should be noted IMO.
Softknobs
22:12I am getting the following error in one script:
*** 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

This is the second time I get this error in on of my scripts (both involve library bindings and callback usage).
The script can be found here and the problem is explained in the "Scenario 2" comment https://gist.github.com/Softknobs/6b7e70f84bb7a34a6f553b8a3b11bdec
It could also have to do with the way I write my scripts but it looks like a bug to me (or a not very explicit error message).
Thanks

endo64
07:50Did you try with recycle/off?
Oldes
08:02I wonder if there is already a way in Red to guard series from being GCed when used in R/S binding too. Only @qtxie or @dockimbel can answer this.
meijeru
08:06@greggirwin It is the type spec for set which is the more restrictive one, rather; for set-quiet I would recommend taking over the one for the word argument.
Softknobs
17:57@endo64 The guard page error is present even with recycle/off
endo64
18:07Where can I download libmicrohttpd-12.dll for Windows (x64)? I've downloaded the latest version but it crashed.
9214
18:10@endo64 https://github.com/Softknobs/RedLibmicrohttpdPoC
endo64
18:13@9214 Thanks!
18:23@Softknobs I reproduced the issue without recycle/off, it happened even for 1 MB file.
But with recycle/off I tested to upload 1, 3, 6, and 17 MB file without an issue.
Softknobs
20:39@endo64 Yes you're right, I did the test a bit quickly and used a different version of the script by mistake. That said, the error should not happen with recycle/on, no?

9214
02:51> I wonder if there is already a way in Red to guard series from being GCed

https://github.com/red/red/blob/master/runtime/allocator.reds#L51
GiuseppeChillemi
11:15does read http://www.slashdot.org fails to you too ?
rebolek
11:16
>> 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">^/^/^-..,
hiiamboris
11:41@GiuseppeChillemi what error do you get?
GiuseppeChillemi
12:32
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
	]
]


The last 2 should be true

>> 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  

>>


hiiamboris
rebolek
12:45
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
toomasv
12:55Same here. (W10)
Phryxe
13:50Win7 - I get a timeout on read http://www.slashdot.org, so false.
hiiamboris
13:53You guys should also add the OS versions. read relies on the OS API.
13:57@Phryxe Same on my W7, for a lot of httpS sites. I think it all started with TLS 1.3 invention. Though I never update it as I'm afraid it'll break more stuff than it will fix. @qtxie doesn't have this error on his W7.
13:58In any case the timeout on W7 is not a Red bug, but Windows' one (although it's not a timeout, Red just reports every http API failure as a timeout). @rebolek's results are interesting though.
rebolek
14:03Unsuccessful reads for first two pages are because invalid UTF-8 encoding
hiiamboris
14:09On Linux?
rebolek
14:09Yes, but I guess it doesn't matter. This problem is usually caused by page's encoding.
hiiamboris
14:10But how come it reads it successfully on the 2nd attempt
rebolek
14:12This must be something caused by their server:
>> 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">^/...
SuperAuguste
15:11I've found a bug when attempting to open a TCP server
15:11open 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:
15:12Has TCP been implemented yet?
9214
15:15@SuperAuguste ports are not in place yet, you should wait for the official announcement and 0.7.0 release.
SuperAuguste
15:16Thanks!
15:16Approximately when will 0.7.0 be released?
9214
15:18No ETA.
GiuseppeChillemi
16:08Strange enough you had statistically opposite results than me. The first 2 sites are Italian language sites being accessed from an italian language Windows 10 machine and the connection was ok. While slashdot is a english language site being accessed from an italian Windows 10 machine. You had the first 2 sites failing 3 over 4 connection attempts and 2 successes on slashdot.
qtxie
16:57You may need to enable TLS 1.2 support on Windows 7. https://github.com/red/red/wiki/%5BNOTES%5D-Enable-TLS-1.1-and-TLS-1.2-on-Windows-7
16:58Some sites force TLS 1.2, even TLS 1.1 is not enough.
hiiamboris
17:14I did that. It doesn't help :)
17:18Hmm maybe the update failed to install. That explains it.
GiuseppeChillemi
17:35@qtxie Should I activate it too ? Windows 10 here and it is not mentioned in your link
qtxie
17:36@GiuseppeChillemi No need for Win10.
GiuseppeChillemi
22:03If it is confirmed I propose to open a ticket
22:04Could I?

Oldes
18:06@GiuseppeChillemi have you tried to use Accept-charset: utf-8 in the http request?
GiuseppeChillemi
18:29@Oldes How should do ? It's a simple read
Oldes
20:21@GiuseppeChillemi like: write http://www.virgilio.it/ [GET [Accept-charset: "utf-8"]]
20:26You may also want to use something like:
set [code header data] write/binary/info http://www.virgilio.it/ [GET [Accept-charset: "utf-8"]]

and check header if content type is charset=UTF-8 before converting data to string
20:28@qtxie is it known issue, that when using not string in the header value, Red crashes?
>> 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

nearlydaniel_twitter
04:36[![Screen Shot 2019-10-10 at 9.29.37 PM.png](https://files.gitter.im/red/bugs/CZ3N/thumb/Screen-Shot-2019-10-10-at-9.29.37-PM.png)](https://files.gitter.im/red/bugs/CZ3N/Screen-Shot-2019-10-10-at-9.29.37-PM.png)
04:36downloaded macOS binary, seems to just not work
04:36
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

rebolek
05:08@Oldes yes, that's a known limitation of simple io
qtxie
05:39@nearlydaniel_twitter Red doesn't support 64bit yet. We're working on it.
05:41@Oldes Yes. We can rewrite the http port once TCP and TLS ports are released.

hiiamboris
15:25Worth an issue?
>> 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:
15:48And this (it forms values when series is a string, right? R2 definitely does):
>> replace "1234" "2" "5"
== "1534"
>> replace "1234" 2 5
== "1234"
endo64
18:26@hiiamboris About vector, no need to fill an issue, I asked similar questions before, like "why vectors don't support all series action, should do they?" but currently there is no final decision about it.
See this issue also: https://github.com/red/red/issues/3711
hiiamboris
18:28Well, it works without the /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]
endo64
18:33Ah, right, I misunderstood.
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]
hiiamboris
18:33Looks like it only doesn't work when value is of vector! type. Disregard what I said about /part :)
18:35
>> insert v make vector! [1]
*** Script Error: invalid argument: make vector! [1]
*** Where: insert
*** Stack:
18:45must be an ez fix btw:
https://github.com/red/red/blob/a4ee537c4b7dd40594db5e5809be8918deef38bd/runtime/datatypes/vector.reds#L1001
just alter the typecheck and pray :)
endo64
18:46:)) I was just on that line in VS Code :)
hiiamboris
endo64
19:16@hiiamboris About replace, changing this line https://github.com/red/red/blob/master/environment/functions.red#L236
from
if system/words/all [any [char? :pattern tag? :pattern] any-string? series] [
to
if system/words/all [any [not any-string? :pattern tag? :pattern] any-string? series] [
looks enough.
19:19Hmm, nope, some tests fail, if pattern is a block.
hiiamboris
19:23So I take it as you agree that it's a bug ☺ I'll make an issue so I don't forget. Thanks for looking into it
endo64
19:27With below change all tests are passed.
if system/words/all [not block? :pattern any [not any-string? :pattern tag? :pattern] any-string? series] [
hiiamboris
19:30:+1:
19:30Since you fixed it, wanna make the PR?
endo64
19:32Sure, just need to add tests.
hiiamboris
19:34https://github.com/red/red/issues/4079 will be the issue
endo64
20:13@hiiamboris What do you think this side effect?
>> replace "a bc" quote (a: b) "x"
== "xc"
hiiamboris
20:16makes sense
20:16also, R2:
>> replace "a bc" quote (a: b) "x"
== "xc"
endo64
20:17Ok then, https://github.com/red/red/pull/4081
hiiamboris
20:20Add "Fixes #4079" magic words to the description :)
endo64
20:30It starts as FIX: #4079.
But 1 test failed: https://ci.appveyor.com/project/red/red/builds/28104237
hiiamboris
20:33Those magic words are recognized by GH and close the issue automagically ☺

toomasv
13:16Bug in 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
hiiamboris
13:34It is by the look of it... I've encountered at times that parse-trace is different from parse. Must be some stack problems as usual.
13:34There's also a return value. If you return no or none from trace func, the result of parse is always yes regardless of the input
endo64
15:49@toomasv What happens when you probe the parameters? What fails?
23:44@toomasv I think we should file an issue for parse/trace.
See also the output of this:
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]

In the output, last input should be empty, but it is not (is it input: [a] so it fails)

toomasv
04:20@hiiamboris @endo64 Thanks! #4084

meijeru
16:47I just found out that the /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_?
hiiamboris
16:59Likely just an oversight :) Nobody thought about a special case for %. and %... Easier to add a slash than make a special case in R/S for adding a slash, right?
meijeru
17:15For uniformity, ls and dir _do_ accept %. as a directory, as does change-dir or cd. Then why not request-file???
hiiamboris
17:18Those *always* 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.
greggirwin
18:17For me, on Win10, if I use %. or %.., I get no requestor at all, which is an issue. Can someone dupe?

The easiest thing is to tell people to use %./ and %../ for those special cases. We should test this across platforms, so we know if it's the same everywhere. e.g. if we "fix" it one place, to add a trailing slash, and that confuses other system OS deep code, that's bad. We want it to be consistent, and I hope that doesn't mean more R/S work for each platform. That is, if using a trailing slash solves it everywhere, we just tell people to do that.
18:17I can justify this thinking, because some funcs are dir oriented, but this refinement arg is ambiguous, so we can ask people to be explicit.
hiiamboris
18:21> Can someone dupe?

Yes. W7.
greggirwin
18:23Ticket time.
dander
19:55Suppose request-file calls clean-path on its /file argument... would that break anything? It seems like it would resolve the %. and %.. cases at least.
greggirwin
22:01Good question, and good idea.
22:02Doesn't work as I'd expect here.
22:03That is, the file part of the cleaned /file arg ends up in the filename box at the bottom, rather than going into that dir.

dander
05:59Hmm, that sort of sounds like a separate issue, since it should probably be the same as if you were explicitly using a full path
greggirwin
15:53If you use %. with clean-path, it's not dirized. This is the ripple effect of design. :^\
15:55Clean-path is due for a design check anyway: https://github.com/red/red/issues/3571

iNode
13:32Hello.

It seems like red 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.

Is this a known issue? Is there any workarounds besides lookup the latest compiled console and execute console directly?
hiiamboris
13:43@iNode I can see that red always exits with an explicit 0: https://github.com/red/red/blob/15b13004d3263ad0a9182be6bcb851b77346f653/red.r#L510
13:43Looks intentional to me, although quite strange indeed.
13:46Worth a ticket IMO
iNode
14:30@hiiamboris Thanks for the feedback. Indeed stange behavior.
14:31Ticket was created https://github.com/red/red/issues/4095. Please let me know if any additional information is needed.
hiiamboris
14:40:+1:

ushakovs_gitlab
16:36
request-file/filter ["MD files" *.md]

crashes console without any notifications or error messages. Windows 7.
hiiamboris
16:49Make an issue on the tracker, I'll fix it. It's exactly in the area I'm working on currently.

9214
14:43Typing something and pressing backspace in GUI console build with debug mode leads to an instant crash. Can anyone reproduce?
*** 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
14:45Ah, [makes sense](https://github.com/red/red/commit/62ca5aa9647eeba9ea8fc64ab83f14dc27408c49). Bummer.
endo64
17:38@hiiamboris warned about this change :)

ne1uno
19:03fast-lexer silent exit/crash with rcalc.red on commandline. built from source yesterday. can anyone confirm?
19:03if comment out buttons M+ M- no crash. also no crash if paste source directly in console. https://gist.github.com/guaracy/a7529831dba08a0fa9c522630a24a425
greggirwin
19:08I haven't seen that fast-lexer is ready for public consumption, but that's a good catch if you can dupe the crash with just those lines. We'll make sure @dockimbel sees it.
ne1uno
19:10wasn't able to simplify it more. but it must be an odd case, only 2 other more complicated scripts crashed so far
greggirwin
19:12Does it still crash if you add spaces around brackets in [attempt[m: m + math to block! load v/text]]?
19:13[attempt[m: being what caught my eye first.
ne1uno
19:29it doesn't crash on a different computer with a few commits newer source. and, a space did fix yesterdays version.
greggirwin
19:52Good to know. Thanks!

meijeru
19:26For the spec document, I was reformulating the rules for how expressions are constituted (see discussion in /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

In other words, whereas a function application can be based on an _expression_ that yields a function, an operator application (infix) cannopt be based on an expression yielding an operator (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.
9214
19:39https://github.com/red/red/issues/3482
meijeru
21:25You are right, this feature is well known since more than a year. I tried now to find other ways of producing an 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...
hiiamboris
21:48You mean that ops and actions that appear *literally* aren't working? Like [3 make op! .. 4]

meijeru
09:09Just try it in the REPL and you will see.

greggirwin
19:26@nd600, did you ever finish the work on that to make a PR?
19:41Right now, I am absolutely OK with saying this is a current limitation, and "don't do that." It shouldn't be a showstopper for anyone.
9214
20:48@nd9600 :point_up:

temperfugit
16:27
Red [needs: 'view]

new-font: make font! [size: 60]

view [
base 500x500 white
draw [font new-font pen black text 2x2 "Hello World!"] 
]

On Windows 10 with the most recent 11/2 build, Red doesn't seem to be drawing new-font's larger font size. I have an older build, "Red 0.6.4 for Windows built 20-Aug-2019/10:02:36-06:00 commit #b24f49e" that does seem to be drawing it correctly. Did the font/draw procedure change or is this a bug?
9214
16:28https://github.com/red/red/issues/4116
temperfugit
16:34@9214 Thank you! The linked thread was helpful, glad there is a workaround for it.

rebolek
12:34Long time no see!
*** Runtime Error 100: no value matched in CASE
*** at: 080E5F7Dh
loziniak
13:39Hi. Got this error when compiling a script with -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]
13:50The minimal script is:
Red [Needs: 'View]
probe load %img/arrow-left.png
hiiamboris
14:06Works for me on an older build.
14:07You tried deleting libRed*.* before compiling, right?
loziniak
14:08Oh, that could be it... I always forget about it.
14:12Maybe there could be a mechanism for a red binary to check if libRedRT is up to date.
hiiamboris
14:15Right, I'd like that too...
loziniak
14:16Indeed, after recompilation of libRedRT it works. Sorry for false alarm.
9214
14:22> Maybe there could be a mechanism for a red binary to check if libRedRT is up to date.

It's called -u flag.
hiiamboris
14:24But it will unconditionally rebuild the lib, no?
loziniak
14:26The problem with -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.
14:31Perhaps -u would be useless, when -c could check libRedRT version and recompile if it's not in the needed version .
9214
15:15There seems to be some severe misunderstanding of how libRed works.

With -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.

If after library compilation you introduce runtime call not previously seen, like e.g. 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.

So, magical "mechanism for a red binary to check if libRedRT is up to date" makes no sense - up-to-date with _what_, exactly?
* Default exports? The toolchain is already aware of them, and if they happen to be outdated, this means that your toolchain is outdated - go grab a fresh build.
* User-specific runtime calls maybe? But for that it needs to analyze your source code and do recompilation, with -u.

Each libRedRT file is _project-specific_, there's no "version" slapped on it. It either contains symbols _your_ project needs (which means it's up-to-date with _the project's state_) or it's not.
hiiamboris
15:21@9214 How does this explain that a single once-built libRedRT works later for every Red program I compile (-c) against it? (until I download a new build)
loziniak
15:21So, when I just change my code, and not toolchain, there is a possibility that libRedRT has to be recompiled?
15:26@9214 this explanation is a fantastic content for a Wiki article!

meijeru
13:35After tinkering with the GUI console (added menu items) I suddenly got an error on 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?
hiiamboris
13:39Compile it.
meijeru
13:40My point is that with a clean console there is no error, whereas if one reads the interpreter code, there SHOULD be an error!
hiiamboris
13:41But it (system/platform) was a *compiled* function, in the clean GUI console.
meijeru
13:41system/platform should not be passing in the interpreter.
13:42I did not change the compiled console, only added some menu items and actors to the console face. Would that cause a switch from compiled to interpreted code?
hiiamboris
13:45Maybe you re-imported system/platform, and so it switched
13:46IDK really, just compile it and that's it ;)
meijeru
13:49Yes, I did system: make system [] so that must explain it. Thanks for thinking with me.
hiiamboris
13:52:+1:
dockimbel
13:54@meijeru You should not do that, there are many #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.

And to answer your probably next question: we'll lock such core words in 0.8.0 from being changed by the user once we get modules and values protection.
9214
13:56@loziniak

> So, when I just change my code, and not toolchain, there is a possibility that libRedRT has to be recompiled?

If you use embedded Red/System with runtime calls, yes.

> this explanation is a fantastic content for a Wiki article!

It's already explained at great length in [this](https://www.red-lang.org/2017/03/062-libred-and-macros.html) blog post. After a re-read, I realized that it does not apply to your code written in pure Red.
meijeru
14:43@dockimbel I understand the implications. But, ... would extend system [], once it will be implemented, not lead to "recreating" the object??
dockimbel
15:47@meijeru Yes, it would, but only internally (reallocating the symbols and values structures). It should be transparent for #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. ;-)
meijeru
16:02@dockimbel My direct needs would be covered by the official addition of a field 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.
dockimbel
16:58@meijeru What would user refer to? Email? Any personal information is rather sensitive to handle lightly these days...
greggirwin
19:25@meijeru why does user need to be in system?
meijeru
20:12Look at Rebol 2. It has to be somewhere, do you have another suggestion?
20:12Please study the Rebol 2 function send which does send mail.
greggirwin
21:33Responded in red/red.

ralfwenske
03:43I am wondering if anyone may have observed what feels like a bug in save. On MacOS I have observed for several weeks:
An app uses save afile anobject and anobject: do load afile.
The anobject contains amongst some fields a map as last item. This map can contain 1000s of entries.
Most of the time it works - however every now and then the load fails like here:
*** Syntax Error: missing #"]" at "^B]"
*** Where: do
*** Stack: show-price load

the last 2 chars should be )]
when the error occurs I then edit these last two chars by manually retyping then (in an editor of course).
After that my code loads the file as expected. So every now and then the save seems to insert a wild character at the end. Any suggestions?
04:02I forgot to mention that - instead of replacing those chars - I sometimes just rerun the (unmodified) saving code and the load works afterwards.
greggirwin
05:10@ralfwenske can you post a small example that reproduces the problem? Then others, and the team, can run it to check.
ralfwenske
05:41@greggirwin mmmh - I don’t think I can as it is a rather complex thing: a master object contains some structure for fields and a host of (database type) functions. Then an object inheriting the functionality contains its individual field-descriptions and respectively a map which then holds all the data (records).

I’ll append the function that saves (which is where I think the last char(s) is occasionally being corrupted).
;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
greggirwin
06:39^B is char 2, so maybe that's something @qtxie can use to narrow the possibilities.
06:44Is there anything unusual about the data in the record maps?
06:46Another thing to try is mold the object to a temp string, and if you see that the file is corrupted, see if the string has the same problem.
ralfwenske
06:58It’s hard to debug as it occurs only occasionally. Also the foreign character varies - always some special glyph though. The data varies but just normal date, strings and number types- in the last case (^B) it was ending like this:
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]
)]
greggirwin
07:03That's good info too then.
ralfwenske
07:11And if I remember right when running the app that saves again it was saved correctly then. To be sure I will keep an eye on it and verify when it happens again.
08:48
2389 [13-Nov-2019 12863.003231554487 13302.571699813932 13073.38083829998 12689.637829467767 12952.15845130321 13993.343448125132 13445.488164615113]
    )ú]

…in case this rings some bell...
09:39I can confirm that when a defective file was saved and I run the unmodified program again the saved file is loadable. So it seems to occur randomly. btw. the files are around 300KB in size. (…and on MacOS)
hiiamboris
11:51There were a few GC-related fixes recently - https://github.com/red/red/pull/4093 and https://github.com/red/red/commit/0d25e8d63b0c24c719221d5530e71de619c7cc61 on the master, https://github.com/red/red/commit/fa22cd7f3709f06bb620803e433b1348c5f2976f on fast-lexer

Plus there's a PR https://github.com/red/red/pull/4097 waiting, that fixes some memory corruption cases in series operations

It would be interesting to see if that bug appears after all these fixes are in the master build
ralfwenske
12:23Thanks @hiiamboris I will keep an eye on it when using the new builds.

meijeru
10:31Bug or feature: dehex does not accept hex values greater than 7F. In Rebol2 dehex "%E9" is e acute (é), whereas in Red, it remains "%E9".
10:32In Rebol 3, it is transformed into the two-character equivalent of the UTF-8 pair C3A9, which is even stranger...
hiiamboris
10:40looks like it wants hexed UTF-8 input?
Oldes
11:23@meijeru here is R3's related issue https://github.com/rebol/rebol-issues/issues/1986
toomasv
12:01Convoluted workaround:
de-hex: func [hex][
    to-char to-integer load rejoin [
        "#" head insert next "{}" pad/left/with copy next hex 8 #"0"
]]
de-hex "%E9"
;== #"é"
12:41Improved:
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"
== #"쎩"
meijeru
13:33I encountered this in the frame of Q-encoding (quoted printable), which is used by e-mail transmission, and where non-printable and non-ASCII characters are encoded as =XX. I found the same workarounds.
toomasv
13:39Instead of load rejoin ["#" head insert next "{}" hex] there should be debase/base hex 16 of course. :flushed:

ralfwenske
02:51@hiiamboris regarding :point_up: [November 13, 2019 1:43 PM](https://gitter.im/red/bugs?at=5dcb7bc5eeb63e1a83a2f8ed)
I just tested with latest red - unfortunately the issue is still there:
)Ò] was in one of two saved files (same code, just different data).
After deleting the Ò 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
Let’s hope for red/red#4097 .

BenStigsen
21:45Hi, I'm not sure how or if it's even possible (although, I'm guessing it is), how do I compile my Red script / application without the console opening after?
21:45Currently after compilation, when I click the .exe file, the console also opens
greggirwin
21:46Add -t windows.
BenStigsen
21:47Oh, yep, that fixed it! Thanks :D
greggirwin
21:50:+1:

Oldes
12:39@dockimbel which result is the correct one?
Rebol3:
>> parse "aabb" [some [#"a" reject] copy rest to end] rest
== "abb"

Red:
>> parse "aabb" [some [#"a" reject] copy rest to end] rest
== "bb"
toomasv
13:15@Oldes , did you use fresh console?
>> parse "aabb" [some [#"a" reject] copy rest to end] rest
*** Script Error: rest has no value
*** Where: catch
*** Stack:

Which makes sense as rest should never be set.
Oldes
13:16Looks like I'm not:)
13:19@toomasv so parse "aa" [some [#"a"] reject] should be false, right?
toomasv

Oldes
16:09I'm still not sure if I get the reject key word correctly... what is difference between reject and fail?
16:16Is this correct result?:
>> parse "ab" [some ["a" fail "b" p: (probe p)]]
""
== true
hiiamboris
16:28It's a mess. See https://github.com/red/red/issues/3478.
16:29There's a whole lot of parse-related issues there waiting, in fact.
Oldes
16:55Hm.. I would need more time to meditate over it ;-)
hiiamboris
17:02In current implementation 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.
17:03Or something like that... ;)
Oldes
18:17I was somehow naturally expecting, that fail will stop parsing not matter how deep inside the rule is and simply return false.
hiiamboris
18:30Well, you're not the only one ;)

LFReD
16:20 ... continuing from red/red

I have two issues now.
1. When saving a hash! of 75,000 strings using save/all in Red, it doesn't work (yet). So I convert the hash to a block! and save that;
saveit: does [

    dbsave: to-block db
    save %db.txt dbsave
    dbsave: copy [] 
    ]


2. When I use that function, it only writes the first 512 kb of the db block and stops.
Oldes
16:30I cannot reproduce it.
LFReD
16:30@Oldes

This function works fine the first time it's called, but only saves 512kb of data the second time
16:30saveit
16:30saveit
Oldes
16:31
>> 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...
>>
LFReD
16:31yeah, the block in memory is fine, it's the %db.txt file that has the issue.
hiiamboris
16:32What build are you using?
16:32>> about
LFReD
16:32stable
Oldes
16:32
>> last db
== "val25000"
>> last db2
== "val25000"
hiiamboris
16:32That explains it ;)
LFReD
16:38Red 0.6.4 for Windows built 21-Nov-2018/16:40:38-08:00 commit #755eb94
hiiamboris
16:40You should update. A whole year has passed.
LFReD
16:55So, i f the binary is buggier than the latest build, maybe time to update the binary?
hiiamboris
16:56It's always buggier ;)
LFReD
17:11Maybe it should be less buggier if you're introducing Red to noobs like me ;)
17:13I'm an end user.. programming languages are tools to me, like a hammer. Oh, my hammer isn't working? Time for a new hammer!
17:15Which is how I found Rebol.. now there's a hammer!
hiiamboris
17:18It's a long way ahead of Red. We can't just exorcise the bugs away ;)
I agree that calling the old build "stable" is somewhat off. I don't know from where this practice came, but here we usually fix bugs, not introduce new ones, so every new build is better, and "stable/nightly" naming doesn't make much sense.
LFReD
17:19I understand it's alpha, and there is really no 'stable' version.
henrikmk
17:20there can always be bugs. the importance is whether the bugs are fixed.
LFReD
18:00Ok.. that was the issue! Using current build and the problem magically disappeared.
greggirwin
19:03We'll try to improve this situation.

dockimbel
19:02@hiiamboris
> I agree that calling the old build "stable" is somewhat off.

So you are advocating for having only auto-builds? So we drop milestones and version number? I'm sure followers will find that very helpful.

> I don't know from where this practice came, but here we usually fix bugs, not introduce new ones, so every new build is better, and "stable/nightly" naming doesn't make much sense.

Can you explain what you mean by "here"?
hiiamboris
19:48No I mean maybe change the name to "milestone builds" or "historical builds" or something. "stable" doesn't fit, does it? But what those stable builds are for, anyway? If there's a point in keeping them, maybe we should explain it on the download page and make a note that "nightly" builds are likely more robust. People outside do not know this, and those who look for less bugs choose to use a build with more bugs. It's not the first time I notice it ☻
19:53I imagine "stable/nightly" makes sense if you have a mature project and you fix features at some point and do extensive beta testing, then call that build "stable", while continuing to work on a nightly one.
dockimbel
20:55> I imagine "stable/nightly" makes sense if you have a mature project and you fix features at some point and do extensive beta testing, then call that build "stable", while continuing to work on a nightly one.

That is exactly what we are doing (though in an alpha software context). We do a huge testing effort for stables, including a lot of manual regression testing on many View demo scripts from red/code and /tests folder that cannot be automated. By definition, stables are more trustable than automated builds, as they go through intense testing, plus we try to squeeze in as many bug fixes from the tracker as possible given the available time. We go through a freezing period where we stop adding any new feature, then go through full testing. If we find any new bug or regression, we fix and do the full testing again. Once we are satisfied with the result, we do the release.
The stable releases are meant for newcomers, to ensure that they can run the demo and test scripts without any bad surprise. The automated builds are of random quality, especially on View parts, as that requires manual testing for regressions.
20:57So in a nutshell, stables are builds of much higher quality than automated ones, in the sense that they can be trusted to be more stable overall.
21:03So, stable builds are expensive to do for us, if we could avoid making them, that would save significant time and energy, but I really don't see how it would be better for newcomers.
21:06That said we haven't made a new one since a year. We usually tie a new release with a new big/significant feature. For 0.6.5, the plan was to focus on the Red console, by adding a plugin API and separate console builds for direct download. Given that we have spent a lot of time on other tasks, we'll probably just keep the direct download part and release it as soon as we can merge the current main dev branches to master (mainly fast-lexer).
hiiamboris
21:07I see. Good to know ;) Do you think we could also somehow automatically cherry-pick bugfixes into stable builds from the nightly branch? At least those that git can manage without manual intervention?
dockimbel
21:11Doable, but that would require a lot of manual testing for regressions after merging those commits. I think it would be tricky to select the right ones without creating issues. There's currently 1123 commits on master since 0.6.4 release.
hiiamboris
21:13Yeah makes sense. That's why I wanted to build a fully automated View testing tool ;) Gregg told me to wait for your approval ☻
dockimbel
21:14You can give it a try if you want. If all scripts in /tests, red/code/scripts and red/code/showcase can run without problem, then we can re-release 0.6.4 with the added fixes and make a nice blog entry about it. ;-)
hiiamboris
21:14Here's what I was thinking of: :point_up: [November 3, 2019 1:07 AM](https://gitter.im/red/GTK?at=5dbdfe3a9c39821509d079fd)
21:16It's a big effort. And though I don't think we can escape building such a tool, but only you know when is the right moment for it :)
dockimbel
21:20> That's why I wanted to build a fully automated View testing tool ;)

That would be nice, but with native widgets, it's difficult to make a test suite that can work reliably on different machines with different flavors of the same OS, or just different user settings. We would need an additional cross-platform widget-set for that (we have that in our plans).
Though, there's already the so-called _test_ backend, that provides a null backend for testing purpose only. It's experimental but should be usable for writing tests for most of VID features and mezz parts of View engine.
hiiamboris
21:24I don't see a problem there. There should be a per-OS set of adjustments indeed, but the point is if it's a 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.
dockimbel
21:24> It should be able to
> simulate keyboard & mouse (and one day - touch) events
> analyze the actually displayed face contents and compare it's properties with facets data

> Mostly it boils down to checking these conditions:
> actors being triggered as expected
> events data is filled as expected
> facets being changed as expected

The _test_ backend should be able to do that already, you should give it a try if you haven't yet. Feel free to extend it to cover more features, it's there for that.
hiiamboris
21:27As an example, how can you test for regression [of this bug](https://github.com/red/red/issues/4162) on a test backend? It only appears on W7 where layered windows are used.
dockimbel
21:28> test backend on the other hand will test itself, not the real behavior of other backends, so I do not consider it perspective.

Right, but there is value in being able to test the backend-independent parts like VID on a headless server. ;-) Then maybe a "T" pipe is needed, to mirror all inputs and changes done on a real backend to the test backend (just thinking loud). So we could use the same tests to run on a headless server (test backend) and the real backends.
hiiamboris
21:29Also a purely behavioral example: https://github.com/red/red/issues/3563
21:30So one of the questions then is, what should I not include into the real View testing tool, that a test backend can handle better.
dockimbel
21:33I think it's very expensive and complex to test for regressions on such cases. Maybe have a look at what other GUI frameworks based on native widgets do for testing? I don't remember seeing any notable testing framework for native GUIs, but maybe there are some to study?
21:33> So one of the questions then is, what should I not include into the real View testing tool, that a test backend can handle better.

Anything that is not directly dependent on the platform and that is slow to test. The test backend can be way faster to use than real ones.
hiiamboris
21:36What's so expensive about simulating a few real mouse events and running screenshot analysis on a set of rules?
21:38There can be even a recording mode that will record all input actions, but I'm not sure if that will worth it. Probably simpler to just write events by hand.
dockimbel
21:38I doubt the robustness of the screenshot approach across the many variations of Windows instances (to name the worst case for such testing). Even simple common variation like changing the default scaling factor would be a show-stopper for such an approach, wouldn't it?
hiiamboris
21:39Not at all. It didn't stop my base-self-test, did it? And it was fairly simple :)
dockimbel
21:40I think we had some issues with those tests at the office on some of our W7 instances, though I'm not sure what was the cause. ;-)
21:43@qtxie Do you remember the kind of issues we had with base-self-test tests at the office?
hiiamboris
21:43Hehe :) Well, that's solved by the idea of computing a compliance score. A rule can match very strictly, or to some extent... or not match at all...
21:44I remember you've had some improperly reported dpi on W10 with scaling factor 200%. And that was a Red issue :)
dockimbel
21:45Possible yes, I remember something along those lines.
hiiamboris
21:47Anyway, think about it and let me know :) I'd love to do this tool.
The general idea is - if I, human, can verify a rule, then my code can do that too. So, I don't see any show stoppers there ;)
dockimbel
21:48If you think that the screenshot approach could work well enough on different Windows instances, then go for it. Having to do manually regression testing on View is slowing down the work on View significantly. Could such testing framework be created only at mezz level or would it need some invasive surgery in View backends?
hiiamboris
21:49No surgery, but at some point I'm sure I'll have to make routines of image analysis functions, to speed it up.
dockimbel
21:50As long it's not invasive in View, not problem with extra R/S code.
hiiamboris
21:50Indeed. Thanks for your thoughts and approval ;)
dockimbel
21:53Well, if your testing framework is as good as you think it would be, then it's me who should be thanking you. ;-)
hiiamboris
21:54
Do you think the new D2D draw branch will help us get rid of layered windows? Or it's irrelevant?
dockimbel
22:01@qtxie is the expert on D2D and layered windows. They should not be related. We needed layered windows on W7 to simulate transparency (at high cost), and IIRC, we don't need them in W10 which has proper transparency support. The work on D2D is to replace GDI/GDI+ as Draw backend.
22:03OTOH, we also plan to use the D2D backend to create some "virtual faces" (not OS window-based) in a new "canvas" widget, for fast and smooth hardware-accelerated animations.
henrikmk
22:05that last bit with virtual faces sounds good, @dockimbel
22:06I'm noticing that lots of people post pictures of rendering differences between GDI and D2D, so I suppose one shouldn't just rely on cross-API pixel consistency, if GDI will continue to be supported.
dockimbel
22:09@henrikmk I thought Pekr would be the first one to jump on that. ;-)
henrikmk
22:10@dockimbel with the GDI/D2D bit?
dockimbel
22:10Virtual faces/canvas part. ;-)
endo64
22:11"virtual faces" are like DDraw surfaces?
dockimbel
22:13I am not aware of the particular rendering differences. I just know that the early tests we did showed that we can get stable 60 fps glitch-free animation on D2D and not on GDI. As I said above, @qtxie spent quite some time studying that, so he could better answer the related questions.
henrikmk
22:18@dockimbel oh, ok. :-) I guess I just really want a good, hardware accelerated REBOL/View clone without any ties to underlying UI kits. that's IMHO the correct way to build a powerful graphics platform that is quick to develop GUI engines on top of.

Recently, I've been prototyping a vertex constraint based UI in REBOL only using DRAW, to see whether it makes sense to do resizing that way (and I think it does). For that, it was necessary to write a very small mini-View, which simply presented faces as boxes of overlapping regions. But with more work, you could get a full-blown View clone.
dockimbel
22:18@endo64 Surfaces should correspond to "canvas" in the View jargon, and the "virtual faces" I mentioned are purely View constructs, so virtual sub-areas in a surface, a bit like gobs in R3.
22:19We can have both classic native GUIs _and_ GPU-powered GUIs.

endo64
00:24[![red-console.gif](https://files.gitter.im/red/bugs/CvsY/thumb/red-console.gif)](https://files.gitter.im/red/bugs/CvsY/red-console.gif)
00:25Can someone confirm above bug? I'm on Win10 / CLI, escape key doesn't clear the refinement that is completed by tab key.
00:26No issue on GUI console.
greggirwin
00:29Confirmed.

GiuseppeChillemi
05:44I am reading you about automated gui test. This let me think about having a window mirrored remotely with or without user interaction possible or a window opened remotely and not locally. Is something like this possible/planned?

henrikmk
19:31I'm trying out the D2D branch, but build.r hanged (ed: hang solved) during the call to the encapper, and I have to force quit, which for me is the classical CALL stability issue with REBOL/View, which requires some workarounds.

Turns out, I had not saved the changes to the encap-paths.r with other than default paths, but this then strands encap inside the CALL, and you can't see any error messages, so a new user might not understand what's going on, as you are not told what happens, if the encap-paths.r file is wrong.

I've found that changing:

call/wait reform [encapper "precap.r -o" bin/:red]


to:

o: make string! ""
call/wait/output reform ["cmd&" encapper "precap.r -o" bin/:red] o


with both /output and "cmd&" being required.

helps for me. However, different REBOL versions might require different fixes, so I'm not sure if it should go in there, or if this issue should be mentioned in the readme? I.e., "if encapper hangs, please check that your encap-paths.r is correct", or something.
hiiamboris
19:38You make it sound like there's a lot of people with Rebol SDK ;)
dander
19:59A while back there was talk about [opening up the SDK](https://www.red-lang.org/2018/03/red-rebol-carl.html) anyone know what happened with that?
GiuseppeChillemi
22:02Bo has tried to talk with Carl but I don't know how it ended.
greggirwin
22:07Thanks @henrikmk. There aren't many who use the SDK, but it's good to note. Not sure if it's in a wiki page on building already or not.

endo64
22:47I'm using the SDK to compile Red every few days, call issue didn't appear after this commit https://github.com/red/red/commit/6aa92f6afe50772f82586e8e58e53e458841a9b3
henrikmk
22:52@endo64 interesting fix. never considered that.
endo64
22:53@henrikmk That was the only fix worked for me (on 2.7.8.3.1), I put call/show "" almost all my R2 scripts because eventually I use call.
henrikmk
23:07@endo64 yeah, ok. I have some other fixes, because CALL is genuinely unstable for me and one of them is to precede the call string with "cmd&"
greggirwin
23:51I use basically the same trick as @endo64, with a wrapper, and a 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.

Oldes
08:58Given the discussion in the /help room, I believe, that 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 #{}]

while I think it could easily give image with 4 pixels (bottom right corner of the original image).
loziniak
09:00Just cross-posting, because I've spotted a bug, and it's not GTK-related, as I thought initially:
https://gitter.im/red/GTK?at=5df8f859ac14cc652c9d64db
hiiamboris
09:56On W7, after -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)
loziniak
14:02ok, bugs reported :-)
hiiamboris
14:03:+1:
greggirwin
20:09:point_up: [December 18, 2019 1:58 AM](https://gitter.im/red/bugs?at=5df9ea200cb24d1d44dd4c90) @oldes, that should just be a small change to 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.

Oldes
10:28I've created a wish for it: https://github.com/red/REP/issues/59 .. but I completely understand it is not a priority for now.
11:12func 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][]
11:17This is related issue: https://github.com/red/red/issues/3171

cdokolas
09:32Hi! Got a (probably) false-positive on gui-console-2017-8-3-49893.exe from Windows Security scan just now. Want the details?
hiiamboris
09:33your version seems 2 years old
cdokolas
09:33That sounds right. How to upgrade?
hiiamboris
09:34https://www.red-lang.org/p/download.html , "automated" builds
cdokolas
09:39Ok. New gui-console executable generated (nice icon) and passed the Windows Defender scan. Old executable remains. Just delete?
hiiamboris
cdokolas
10:18thanks!

GiuseppeChillemi
23:26find, replace and change have no return: defined. Is it correct ?

greggirwin
03:13We can add them, but it's not critical right now. They are only used by help at this time.
GiuseppeChillemi
05:35I don't need them, I am just reporting what I have spotted while analizing Red function spec blocks.

hiiamboris
13:46My 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.

Meanwhile, has anybody encountered instabilities in recent builds as well?
toomasv
15:49Yes, my 18-Dec build tends to crash too if left unattended for some time.
greggirwin
20:15There was an issue with that long ago. Sounds like a regression.

ne1uno
14:19fast-lexer-2019-12-30 d7958d8
14:19either false [prints words-of system/words][print none]
14:19>** Syntax Error: (line 1) invalid path at ][print none]
14:19>** Where: transcode
greggirwin
20:08Thanks @ne1uno, likely work in progress that will be fixed by @dockimbel shortly.