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

Oldes
16:55I believe, that there should be %"" instead of none in these cases:
>> split-path %/
== [%/ none]
>> split-path %./
== [%./ none]
>> split-path %../
== [%../ none]
hiiamboris
17:12looks like it will be a win in some cases and loss in others
greggirwin
17:18@Oldes I can dig out my old split-path tests, based on Ladislav's idea that rejoin split-path should produce the original result. I always liked that idea, but as @hiiamboris it's not a silver bullet, just a different design choice.
Oldes
17:20@hiiamboris can you be more specific? For me it is clear issue. It does not make sense to have 3 exceptions, where there is none.
hiiamboris
17:36well, for example you could put split-path into until until loop and check if file part is none
17:36or just use default filename when it is none
17:37both cases are a bit shorter with none than with %""
17:37I'm not against either design
17:39but this is totally an inconsistency:
>> split-path %""
== [%./ %""]

enough to open an issue
greggirwin
18:18Here's one I drafted some time back that matches the current behavior, but is much simpler.
split-path: function [
	"Returns a block containing a path and target."
	path [any-string!]
][
	target: any [find/last/tail path slash   path]
	reduce [copy/part path target  to file! target]
]
hiiamboris
18:25PR it :)
zentrog:matrix.org
18:25Could it be that the problem is not with split-path, but with rejoin?
>> rejoin [%/ none]
== %/none

Why does it convert none to %none? I know it's just just forming it, but it doesn't seem that helpful to me. The empty file %"" seems weirder to me than none for "no file"
greggirwin
18:28Sorry, mine does *not* match the current behavior, which is probably why I didn't PR it. But it *does* hold true to rejoin.
18:30@zentrog:matrix.org if none formed to "", you would never see it in a lot of output.
zentrog:matrix.org
18:40I don't mean changing form, but rejoin, since it is producing a file!, not a string! in this case. It just seems weird to me that you would get a file named "none" out of the value none.
toomasv
18:47Could use trim?
rejoin trim split-path %/
== %/
greggirwin
19:24While we can work around it, the best thing to me seems to be making split-path the best it can be first.
gltewalt
19:28
>> help split-path
Func spec couldn't be parsed, may be malformed.
func [


greggirwin
19:39I added notes and comments to https://github.com/red/red/issues/5024
hiiamboris
19:40@gltewalt can't reproduce
greggirwin
19:40@gltewalt good catch. We're going to see a lot of that now, as the interpreter events changed func specs. Oy.
19:41split-path now has [no-trace] in it.
hiiamboris
19:41oh, on newer build I can
greggirwin
19:41clean-path and layout are also broken.
19:44Patching help now.
gltewalt
19:45@greggirwin split-path is too dense. Your split-path is better, is it not?
greggirwin
19:48The old one is pretty dense, but at least not too large. Mine is *different* and a breaking change, so not to be considered lightly. If we want magic relative dirs added, per my comments on the ticket, mine will get uglier as well.
gltewalt
19:50@hiiamboris Yeah Red 0.6.4 for Linux built 30-Dec-2021/17:47:48-07:00 commit #972994d
19:54According to this Splits a file or URL path. Returns a block containing path and target, split-path %"" should be [%./ none] Right?
19:57Because their is no target.
zentrog:matrix.org
19:58From a purely logical standpoint, the existing behavior makes sense to me. If the function is meant to always return a directory part with a file part - I like none better for "no file part", instead of a file! which cannot exist. But maybe there are some use cases which are really awkward dealing with that? I've never used it so far though. I always run into little things that are different from my expectations, and it's not always clear to me what the idiomatic way would be.
gltewalt
19:59And none is a result of find when find fails
zentrog:matrix.org
20:00A test could be added which checks that all defined function specs are valid
greggirwin
20:11@zentrog:matrix.org that's a good use case for a static analyzer. This is a case of help being specific in the attrs it checks for, rather than just accepting a block, and suffered the classic fate of other changes breaking that. :^\
20:13It's also an interesting area because people can write new func-making wrappers that don't follow the same spec, and which help will then choke on. What it does in that case is show you the source as a fallback.
gltewalt:matrix.org
20:23Hey, I use the wrong "there"
greggirwin
20:59I all do that sometimes.

GiuseppeChillemi
20:41Could user defined part be added to the new function specs? I mean [USR: [content]] and everything inside it is ignored but accessible. It would be great for flagging, tagging, cataloging, so extending the functions info.
hiiamboris

rebolek
06:07It can, if you write your own function constructor.
06:09Or you can abuse refinements for that
gurzgri
07:48Is this to be considered a bug? I would expect LENGTH? to return 20, but it returns what seems to be a memory address or some other random value:

Red []
register-scheme make system/standard/scheme [name: 'len actor: context [
    open: func [port] [port]
    length?: func [port] [20]
]]
probe length? port: open len://test ;== 75611332

Or is it some kind of misunderstanding on how port schemes are supposed to be implemented?
rebolek
08:20Interesting. @qtxie do you know what is going on here?
Oldes
08:54@gurzgri it's a bug... the length? on opened len port should return 20 according your spec.
08:55In Rebol3 it is:
sys/make-scheme [
	name: 'len
	actor: [
	    open: func [port] [port]
	    length?: func [port] [20]
	]
]
length? open len://test ;== 20
gurzgri
09:00I'll open a ticket then, thanks for confirming.
gltewalt
17:21
>> b2: ["aa" "bb"]
== ["aa" "bb"]
>> unique form b2 
== "a b"

>> b2: ["aa" "bb" "cc" "dd"]
== ["aa" "bb" "cc" "dd"]
>> unique form b2 
== "a bcd"

hiiamboris
gltewalt:matrix.org
17:23It's unique-ing space also?
gurzgri
17:28
>> unique probe form b2: b2: ["aa" "bb" "cc" "dd"]
"aa bb cc dd"
== "a bcd"

(edit after re-reading your question:) Yes, it uniquifies spaces, too. unique on strings removes all duplicate chars just as it should, I'd say.
gltewalt:matrix.org
17:32Should it be when applied to string though
gurzgri
17:35Yes it should, as per definition. unique removes all duplicate values from string arguments.
17:35i.e., all duplicate chars
gltewalt:matrix.org
17:51That it does according to description, and "should it?", are different things
gurzgri
17:58Ah, I'm sorry, I didn't realize that you're actually proposing a different behaviour than the one spec'ed. Then you'll probably need some very good arguments for your proposal, because that would be a very breaking change.
greggirwin
19:17@gltewalt:matrix.org I second @gurzgri here. First, tell us why it should. Think about all the other cases, including non-string cases, what they should return, and how you'll reason about them. Maybe throw a sort in there to prime the problem pump.

greggirwin
00:01@GiuseppeChillemi WRT https://gitter.im/red/bugs?at=61db48616d9ba23328b2ab38 and func metadata, it needs to be a fully-fleshed out proposal. Metadata is good, but we don't want func specs to become bloated. It's also important to think about whether, or how the data may be used at runtime, and how it may be exploited as a security risk. Even in a live system, like Smalltalk, it sometimes makes sense to separate the data for processing and handling.

For example
Re: WRT: func ['name content][ <add content to system catalog> ]
WRT incr [<INCR metadata here>]


With an approach like this, you can still put the data close to the context of the function, but can also spec more definitively what its purpose is, formats allowed, etc. With a general dumping ground, things get much messier, as I'm sure we'll see in the wild with face/extra.
toomasv
08:24@GiuseppeChillemi But you can also define you func in context containing metainfo, e.g.:
>> context [meta: "My additional thoughts on this func" set 'my func [arg /meta][if meta [print self/meta] arg]]()
>> my/meta 1
My additional thoughts on this func
== 1
GiuseppeChillemi
23:13@toomasv This solution is good but not readable.
23:48@greggirwin
> With a general dumping ground, things get much messier, as I'm sure we'll see in the wild with face/extra

I like this idea as it gives the flexibility you need. self/extra or /user and you can store and you LOAD without reducing anything.

I am experimenting with using this inside the function's body (I would prefer having it in function's SPECH)

F-INFO: [
		STATUS: []
		VERSION: 1.0
		LOG: {}
		TODO: {}
		NOTES: {}
		DOCS: {}
		IDEAS: {}
	]


But I have found it can also be included in specs body using this technique:

f: func [
  arg 
  /local
  any-local 
  F-INFO {
		STATUS: [WORKING]
		VERSION: 1.0
		LOG: {}
		TODO: {}
		NOTES: {}
		DOCS: {}
		IDEAS: {}
}
] [
  <my-function-body>
]


And you can get it using:

>> parse spec-of :f [thru 'f-info s: (probe info: load first s) to end]
[
    STATUS: [WORKING] 
    VERSION: 1.0 
    LOG: "" 
    TODO: "" 
    NOTES: "" 
    DOCS: "" 
    IDEAS: ""
]

Now info contains our information block.

I am starting to adopt this technique so I can start to keep track of each function stage of development as we do with the script header.

greggirwin
00:10As long as you accept the risk that Red may break code that does clever things like this. :^)
GiuseppeChillemi
08:58In this case, first position in the body of function is a safer place.
16:11@greggirwin Do you think we could continue this discussion elsewhere?
greggirwin
19:36I don't like the func body hack either. Nenad and I talked about it recently. I'm overloaded, but if others want to chat in red/red or elsewhere for fun, I will at least skim things.

hiiamboris
14:38@greggirwin this quite surprised me when I used it inside the lexer's trace func:
>> x: block!
== block!
>> ? x
    code             length: 0 index: 24 []
    b                length: 0  []
    p                length: 0 index: 7 []
    e                length: 0 index: 3 []
    included-scripts  length: 26  [%/d/devel/red/common/expect.red %/d/de...
14:40I understand technically there's no difference between ? x and ? block! but talk about shooting off one's feet..
14:41Somehow in R2:
>> x: block!
== block!
>> ? block!
Found these words:
   any-object!     block!    length: 3
   any-path!       block!    length: 3
   bar-effect      block!    length: 4
   base-effect     block!    length: 4
   ctx-edit        block!    length: 152
   ctx-viewtop     block!    length: 371
   datatypes       block!    length: 54
   dtw-keymap      block!    length: 18
   immediate!      block!    length: 17
   internal!       block!    length: 3
   scalar!         block!    length: 7
   suffix-map      block!    length: 25

>> ? x
No information on x (word has no value)
14:42the output I don't even understand :)
14:42why would it have no value..
toomasv
15:16That's what I get in fresh console (Jan 11 build, W10):
>> x: block!
== block!
>> ? x
No block values were found in the global context.

And in not so fresh I get looots of blocks:
>> x: block!
== block!
>> ? x
    val              length: 6  [455x1055 15x15 square to-right 0x0 []]
    B1               length: 119 index: 2 [translate 0x0 [push [fill-pen 0.0.0 line-width 1.0 box 0x0 15x1...
    B2               length: 115 index: 6 [translate 15x0 [push [fill-pen white line-width 1.0 box 0x0 15x...
...
hiiamboris
15:35well I must have had some globally defined blocks
>> x: block!
== block!
>> ? x
No block values were found in the global context.

>> ? block!
No block values were found in the global context.

>> b: []
== []
>> ? x
    b                length: 0  []

>> ? block!
    b                length: 0  []
15:35anyway what I wanted to know is what x's value is, not how many blocks there are around :)
15:36x in this case is the type parameter passed to me by the lexer, and I wanted to know if it passes me words or datatypes (?? is of no help here, nor mold/all)
toomasv
16:02Ah, sorry, my head is a bit hazy now... so, why type? is not good?
hiiamboris
16:07it's what I did eventually print [type type? type], but obviously during debugging I'd like to intrude less into the code, so ? was my first try
gltewalt:matrix.org
16:42Quote it?
gltewalt
16:48
>> x: 'block!
== block!
>> ? x
X is a word! value: block!

>> ? (reduce x)
    b                length: 0  []

hiiamboris
16:49I don't get to choose what lexer spits at me.
gltewalt
17:07datatype? ?
gltewalt:matrix.org
17:10That should say yes or no to if it passes you a datatype
hiiamboris
17:11you're totally missing the point ☻
gltewalt:matrix.org
17:12Does not surprise me, but that's what you typed
hiiamboris
17:30R3 btw:
>> x: block!
== block!

>> ? block!
BLOCK! is a datatype.
It is defined as a series of values.
It is of the general type block.

Found these related words:
  datatypes       block!     length: 57 [end! unset! none! logic! integer! decimal! percent! money! char! pair! tu...

>> ? x
X is a datatype of value: block!
17:32there's a great idea there, brilliant even:
>> ?? ?
...
 datatype? :value [
     spec: spec-of :value
     either :word <> to word! :value [
         output ajoin [
             "^[[1;32m" uppercase mold :word "^[[m is a datatype of value: ^[[32m" mold :value "^[[m^/"
         ]
     ] [
         output ajoin [
             "^[[1;32m" uppercase mold :word "^[[m is a datatype.^[[m^/"
             "It is defined as" either find "aeiou" first spec/title [" an "] [" a "] spec/title ".^/"
             "It is of the general type ^[[1;32m" spec/type "^[[m.^/^/"
         ]
         unless empty? value: dump-obj/match/only system/contexts/lib :word [
             output ajoin ["Found these related words:^/" value]
         ]
     ]
     throw true
 ]
mikeyaunish
19:37@hiiamboris here is what I get.
>> x: block!
== block!
>> ?? x
x: block!
>> v: mold x
== "block!"
greggirwin
20:01Here's what I get in R3 (Atronix). You must be using a different one. Maybe @Oldes version based on the escapes in there.
>> x: block!
== block!

>> ? x
x is a datatype
It is defined as a series of values
It is of the general type block

No values defined for x
>> ? block!
block! is a datatype
It is defined as a series of values
It is of the general type block

Found these related words:
   datatypes       block!    length: 58

So ? x is not helpful there IMO. And this is the key question: What should help do?
hiiamboris
20:04do what Oldes' R3 does
greggirwin
20:09Open a ticket if you want. Can't think deeply about it right now.
hiiamboris
20:18done

toomasv
13:25This crashes console on W10:
x: [a 1] case/all [a: x/a [a] b: x/b [b]]
hiiamboris
13:45true
13:45better report that to Nenad though ;)
toomasv
14:42Another problem with console on W10: generate a view, let it fall behind some other window, close the view without bringing it into foreground first -- console that produced the view hungs.
hiiamboris
14:57view [base rate 0:0:3 on-time [unview]] works for me
14:58oh if I kill it from task manager then hangs
14:58actually it still works just doesn't print anything
14:59I can type view [] (enter) and show another window :)
14:59create an issue
toomasv
15:03This does not correspond to my description. Do this: in console enter view [base]. Click into console. Mouse over console icon in bottom of screen and close the view from there. My console hangs. Does yours?
hiiamboris
15:10like I said it doesn't hang
15:10try inputing ESC view [] ENTER blindly even though it doesn't reflect keystrokes
15:11menu also works
greggirwin
20:24Confirmed case/all crash.

Console hang issue confirmed as well. Scroller itself still moves, but the text area doesn't respond.
mikeyaunish
20:54Checking in on a new behaviour.
Red 0.6.4 for Windows built 4-Feb-2021/17:06:04-07:00 commit #6440af5

>> foreach i jo [ print [ type? i mold i ]]
datatype logic!
datatype percent!
datatype date!
datatype file!
datatype tuple!
datatype pair!
datatype string!
datatype word!
datatype set-word!
>> find jo file!
== [file! tuple! pair! string! word! set-word!]

Since Feb/2021 build find gives this result:
>> find jo file!
== none

I can work around this. Just checking to see if this is an intentional change?
greggirwin
21:31This feels like a regression related to /only. You can use find/only for now, but we should check tickets, as there are a couple related to this.
21:32https://github.com/red/red/pull/4924
hiiamboris
21:42this is september though
21:45I confirm this is the cause and it was intentional. Now:
- /only finds file! datatype
- no-/only - finds any value of file! datatype
21:45before this PR it was a crazy mix of both
greggirwin
22:22Thanks @hiiamboris.

mikeyaunish
00:44Great - thanks for clearing that up. The new usage makes sense.

Oldes
22:32It is nice, that trim works on binary as:
>> trim/head #{0011002200} 
== #{11002200}
>> trim/tail #{0011002200} 
== #{00110022}

But I believe, that when used trim/head/with, it should throw an error, that incompatible refinements are used instead of ignoring the /head silently:
>> trim/head/with #{0011002200} 0
== #{1122}
22:35The same with normal string:
>> trim/head/with "abcabc" #"a"
== "bcbc"
gltewalt
22:38There are other instances of functions with incompatible refinements. No errors thrown.
hiiamboris
22:39all of them should be fixed :)
Oldes
23:36And this seems to be clear error:
>> head trim/tail back tail #{0000110000}
== #{0000110000} ;<--- Wrong, should be #{00001100}

This is ok:
>> head trim/head back tail #{0000110000}
== #{00001100}

greggirwin
00:03Why would /head and /with` be incompatible, conceptually?
gltewalt:matrix.org
00:53If they shadow, or "clobber" each other silently.
greggirwin
00:59That's a bug. You should be able to say "Trim only from the head, and use this alt value." at the same time.
gltewalt
01:00Unless im miss remembering there are others that clobber
Oldes
06:21:point_up: [January 21, 2022 1:59 AM](https://gitter.im/red/bugs?at=61ea055c742c3d4b21a9f772) That would nice, but it is not as easy as to add the error message for now... currently /with is same as /all, but with alternate chars... as is noted in the doc string:
/with        => Same as /all, but removes characters in 'str'.
        str          [char! string! binary! integer!]
06:25https://github.com/red/REP/issues/52
07:08
red
>> trim/tail #{000000}
== #{00}
07:17Silently ignored /with:
>> trim/with [#[none] 1 #[none] 2 #[none]] 1
== [1 2]
07:19not to mention, that: trim [#[none] 1 #[none] 2 #[none]] should be [1 #[none] 2] instead of [1 2], because that is known issue https://github.com/red/red/issues/4210

greggirwin
20:55
>> sort/compare [[a 3] [c 1]] 2
*** Script Error: incompatible or invalid refinements
*** Where: sort
*** Near : 2
*** Stack:

Should work. In May-2020 it changed from "value out of range" to this error. I don't see a ticket for it. Does anyone know of this being reported already?
hiiamboris
20:58no it's not reported
greggirwin
20:58Thanks. :+1:
21:06https://github.com/red/red/issues/5050

gltewalt
01:25should body-of applied to a native! give an error?
01:25The latest build returns an integer
01:27
>> body-of :zero?
== 98
>> add body-of :zero? body-of :print
== 121

02:47What the heck?
>> set/some [a none c][1 2 3]
== [1 2 3]
>> a
== 1
*** Script Error: ask does not allow integer! for its question argument
*** Where: ask
*** Near : result
*** Stack: ask
02:47Fresh session. a not previously set to anything
greggirwin
04:31Body-of returning an int is something we can note, about why, but it doesn't hurt anything to do so at this time.

In the second example, you are redefining none to be 2, so all bets are off on behavior after that.
gltewalt:matrix.org
04:33Isn't set/some not supposes to set none ?
04:34Even if it's backwards
greggirwin
04:34Nope. It does not treat 'none specially if on the left hand side.
04:34Because it's not a none value, it's just a word.
04:36And, yes, this can lead to "Should Red have at least a *few* keywords to avoid this kind of thing?" The answer being: No. :^) At least not until somebody comes up with a complete and rock solid proposal for that.
04:36Note that the doc string clearly states "In a block or object *value* agrument".
gltewalt:matrix.org
04:39Yep but if for some reason they have unrelated blocks and decide to set the wordss of one to the values of the othet
04:40Low probability, but chaos ensues
04:43Any complete proposal shouldn't be more than: none, true, false
04:46Maybe... NaN
gltewalt
12:32I haven't looked at how reflect works yet, but:
>> probe get 'print
make native! [[
    "Outputs a value followed by a newline" 
    value [any-type!]
]]
12:33Which is better than 23
12:37And, am I further confused?
>> set/some [a b c][1 none 3]
== [1 none 3]
>> b
== none
rebolek
12:45@gltewalt what’s your confusion here?
gltewalt:matrix.org
12:52Spec says it isny supposes to set a word to a none value?
12:52Isn't supposed to
rebolek
12:55Ah, I see.
12:57Again, you are confusing none word with none! value.
>> type? b
== word!
12:58If you do reduce [1 none 3], it works as expected.
12:58or [1 #[none] 3]
gltewalt:matrix.org
14:52I know that none in an unreduced block is just a word.
Isn't it the job of /some to check the value (reduce)?
If the words none are fine to set, no reason to use/some. Just use set.
hiiamboris
14:55why would set reduce anything?
gltewalt:matrix.org
16:38The some refinement would iterate, get the value, and act accordingly
16:39Set by itself shouldn't
hiiamboris
16:56don't complicate things :)
gltewalt
17:26Looks like it's not an issue if collecting values. The issue is the human not being able to tell if it's #[none] or none if they look at a block of values that has been collected.

17:27
>> x: ["a" "b" "c"]
== ["a" "b" "c"]
>> y: [none none none]
== [none none none]
>> type? y/1
== word!
>> z: collect [foreach i x [keep find i "Oh"]]
== [none none none]
>> type? z/1
== none!

hiiamboris
17:33what's b?
gltewalt
17:33Oh... I forgot to change it
17:33There
17:34That begs the question, should functions returning none, return #[none] ?
hiiamboris
17:35funny, they actually do return #[none]
17:36you got a really strange mental model there
gltewalt:matrix.org
17:37Lexically they don't. For the humans.
hiiamboris
17:38but it's humans who prefer none as it hurts the eye less
rebolek
17:39I agree it can be confusing sometimes and having literal none (and logic values) would make things easier.I sometimes run into that too, especially in parse where you write a dialect that checks for none! and depending if a human writes it or if the machine produces it, none can be either a word! or none!.
gltewalt:matrix.org
17:39Maybe so, but then they have to check types. Can't tell by looking
rebolek
17:40OTOH all words have invisible properties in Redbol.
17:40Like context.
gltewalt:matrix.org
17:40You see I'm not so crazy
rebolek
17:40It’s just that you need to get used to it.
17:41Red is different than most of the languages, but it’s different for a reason.
17:41Can some things be improved? Certainly. Do you know how? Write a proposal.
gltewalt:matrix.org
17:43Can you give an example of when literal none, true, and false would be bad?
rebolek
17:44That’s not the point. The point is, how would they look?
gltewalt:matrix.org
17:44Honest question though, as I cant off the top of my head, but I'm nowhere near a guru
rebolek
17:44You can’t use none because that would limit its use in dialects if it wouldn’t be a word!.
hiiamboris
17:46perhaps we should write this reasoning down somewhere for the future reader
gltewalt:matrix.org
17:46I guess they would look like the construction syntax, since users are already exposed to it
17:49It would probably go in Guru Meditations on the wiki. But I don't know how much it gets used.
hiiamboris
17:55or I might load some XML: texttext and having none as keyword would trip me up
gltewalt:matrix.org
17:57#[keyword] ?
hiiamboris
18:06you already have that
18:06just use mold/all
rebolek
18:08@gltewalt:matrix.org #[none]
greggirwin
20:11> Any complete proposal shouldn't be more than: none, true, false

What about [on off yes no]? Those are also logic values and will break code that uses them just like [true false]. And unset? *All* the datatype! words? Those suffer the same problem. Then what about if and every other standard function. You tripped over none, but redefining any standard function will break code. The more common, the more code.

This design aspect is fundamental to Red. @rebolek noted a key reason: dialects.

Any complete proposal is going to take a long time and be a lot of work, because it has to address *everything* related to words, their evaluation, and their forms.

The issue of construction syntax (serialized form), and whether or how to show more details by default in the console, is in active chat by the team.
gltewalt:matrix.org
20:30On off yes no, are aliases. Unset is like none, but datatype! words are not.
I dont think anyone talks about making function names reserved.
20:31Easier to browbeat you over coffee
greggirwin
20:49If you're going to browbeat me, you're buying. ;^)
rebolek
22:35> Unset is like none, but datatype! words are not.

of course they are! There's the same difference between none unevaluated word! and none evaluated to none! and for example unevaluated string! word and evaluated string! datatype!.

gltewalt:matrix.org
00:27None, true,, and false, are self describing. They act as pseudo constants.
You know if evaluated, none means none!. true means true! false means false!
Sure, you can do none: "hi" or similar.

s: "string"
s is not "self describing", so string! Isn't like none!
greggirwin
00:28I think @rebolek meant string! and string!. Can you tell which is a word and which is a datatype?
gltewalt:matrix.org
00:36Ah, I see

ralfwenske
01:53[![image.png](https://files.gitter.im/5902e8c1d73408ce4f5b94ba/2vRG/thumb/image.png)](https://files.gitter.im/5902e8c1d73408ce4f5b94ba/2vRG/image.png)
01:57[![image.png](https://files.gitter.im/5902e8c1d73408ce4f5b94ba/SfG9/thumb/image.png)](https://files.gitter.im/5902e8c1d73408ce4f5b94ba/SfG9/image.png)
01:59I’m playing with Red again on Linux Mint and Mac.
The above works on Linux fine (apart from the size difference between slider and progress bar).
On Mac I get an error (see above).
Red 0.6.4 for macOS built 25-Jan-2022/2:32:52+10:00 commit #ae5482d
Linux is also from 25-Jan-2022
(the same if I use view [ title "TABS"….
hiiamboris
10:17What exactly causes the error?
ralfwenske
10:49I can only guess that it might be in layout. Like I showed it works in Linux. I think that a synched ‘*.red’ source should result in identical result when run in linux, mac or windows version of the same red compiler.
10:50(version)
hiiamboris
11:12try to minimize your snippet until you figure out what's causing it?
ralfwenske
11:30Sorry @hiiamboris - I could have done this in the first place.
progress is the culprit. The program works on Mac when I comment it out.
Red [ needs: 'view]
view [ below
    progress 100x20 data 20% react [face/data: s/data]
	s: slider 100x20 data 20%
]

results in (not on Linux - only on Mac):
*** Script Error: float! type is not allowed here
*** Where: eval-set-path
*** Near : no
*** Stack: view layout eval-set-path
hiiamboris
11:43does it happen during face/data: s/data?
11:45what if you remove s line and react?
greggirwin
19:18I think @ldci reported a progress issue not long ago. We have other tickets for it, but I don't see that one.
ralfwenske
21:31[![image.png](https://files.gitter.im/5902e8c1d73408ce4f5b94ba/ssCO/thumb/image.png)](https://files.gitter.im/5902e8c1d73408ce4f5b94ba/ssCO/image.png)
21:35[![image.png](https://files.gitter.im/5902e8c1d73408ce4f5b94ba/YgiJ/thumb/image.png)](https://files.gitter.im/5902e8c1d73408ce4f5b94ba/YgiJ/image.png)
21:38[![image.png](https://files.gitter.im/5902e8c1d73408ce4f5b94ba/ZjCh/thumb/image.png)](https://files.gitter.im/5902e8c1d73408ce4f5b94ba/ZjCh/image.png)
21:40
Red [needs: 'view]
view [
    progress 50% 100x20   
]

on Mac leads to:
*** Script Error: float! type is not allowed here
*** Where: eval-set-path
*** Near : no
*** Stack: view layout eval-set-path


hiiamboris
21:42good! now please create an issue so @qtxie can fix it
greggirwin
21:51Thanks for tracking that down @ralfwenske !
ralfwenske
22:02Ticket: Progress bar on Mac causes script error #5056

ldci
07:36For macOS there is a problem with pair!. This code runs
Red [
	needs: 'view
]
view [
    p: progress 200 
    do [p/data: 50%]
]

qtxie
12:58IIRC, the height of the progress bar cannot be changed on macOS and GTK. I agree it should accept pair! without error.
Oldes
18:40Having...
>> #{11111111} xor #{ffffffff}
== #{EEEEEEEE}

Than isn't this wrong?
>> head ((skip #{11111111} 2) xor #{ffffffff})
== #{EEEEFFFF} ;<---- I expected #{1111EEEE}
>> head ((skip #{11111111} 2) xor #{ffff})
== #{EEEE} ;<---- I expected  #{1111EEEE}
hiiamboris
18:48looks weird, however R2 does the same..
Oldes
18:48It does... but I think it is a bug
hiiamboris
18:49how come Red and R2 has the same bug though?
Oldes
18:49the index is ignored.. easy to happen.
hiiamboris
18:50actually I think it makes sense what it does
18:50I got it
Oldes
18:50It does not make sense to me
hiiamboris
18:50
>> #{1111} xor #{FFFFFFFF}
== #{EEEEFFFF}
18:50it created new series
Oldes
18:51ah... right.. so the first is right.
hiiamboris
18:51both are
Oldes
18:52But I want to modify only the tail of the first binary
hiiamboris
18:53can't think of a builtin solution..
Oldes
18:53In the same way how it is for example:
>> head uppercase skip "aaaa" 2 
== "aaAA"
18:54So I think, that it ignores the index as I said and just pads the shortest value with 0
hiiamboris
18:55ideally there should be some xor-in-place routine that xor would dispatch to but it should be a REP
Oldes
18:56why there should be xor-in-place?
hiiamboris
18:56isn't that what you want? modify the buffer?
Oldes
18:57I wanted:
>> head ((skip #{11111111} 2) xor #{ffff})
== #{1111EEEE} ;<--- not #{EEEE}
hiiamboris
18:57that's actually #{EEEE}
18:58
>> head ((skip #{11111111} 2) xor #{ffff})
== #{EEEE}
Oldes
18:58Now it is, but I don't want it to be :/
hiiamboris
18:58you want the original buffer modified, yes
18:58write a routine :)
Oldes
18:59But the reason probably is, that it does not modify the source, but creates a new binary
18:59so it is not a bug:/
hiiamboris
18:59> creates a new binary

as it should :)
Oldes
hiiamboris
19:00why do you need to modify the original though? is it big?
Oldes
19:00Ok.. I can pad the second with zeros to get the expected result:
>> #{11111111} xor #{0000ffff}
== #{1111EEEE}
hiiamboris
19:01yeah or change it with the result depending on your needs
zentrog:matrix.org
19:51> Ok.. I can pad the second with zeros to get the expected result:
@Oldes only if the input is all ones though... it needs to be padded with the input inverted
Oldes
19:53Right. I don't want to create so many copies anyway... better to do it byte-by-byte. And optimize later.

Oldes
09:50
red
a: make block! 0
b: at [1 2 3 4 5 6 7 8 9] 5
insert/part a b -2
a ;== [5 6 7 8 9] ;<---- it should be [3 4], like in Rebol!
greggirwin
19:31Hmmmm. This feels like it should be an error. Just a couple quick checks make me think we need to spec this behavior across the board. e.g. sort seems to honor it, but reverse does not, and reverse/part b -3 in R2 is an error.

If it's going to work, it should work consistently.

@Oldes do you depend on this behavior?
Oldes
19:46@greggirwin no, I don't depend on it... But I want Rebol/Red compatibility and I was just trying this code https://www.curecode.org/rebol3/ticket.rsp?id=856

Why you have a feeling, that is should be an error? To me it is clear, that it is a bug. If there can be
copy/part b -2 ;== [3 4]

Than it should work also with insert and append.
19:47And it is known issue -> https://github.com/red/red/issues/4106
19:52And the reverse/part should also work... in Rebol3 it does:
>> b: [1 2 3 4] reverse/part tail b -2
== [4 3]
>> b
== [1 2 4 3]
greggirwin
20:14> Why you have a feeling, that is should be an error?

Where you think it should work because another func works that way, I'm looking at it from "What does a negative part even mean?"

> /part Limit the length of the result.

You can't have a length less than zero for a series. Given a series! value for length/range is different than an number!, so we need to define the behavior for both.

In the grand scheme, we have to ask if something is useful, and whether it's a win overall when it comes to writing code we can reason about. Another important question is if we disallow something now, can we allow it later without breaking code? In this case, we can.

I'm not saying we *shouldn't ever* support negative part amounts, but I *am* saying that we shouldn't propagate unspecified behavior. +100 for a complete /part evaluation, design spec, and proposal. :^)
20:15Note that @hiiamboris has a general part func and design as well, which should be the first thing someone looks at.
Oldes
21:35Negative length/range is something, what is completely normal in Rebol... it is sad, that in Red one would have to write:
append buffer copy skip tail b -2

instead of shorter and more optimal:
append/part buffer tail b -2

hiiamboris
21:40I totally agree with Oldes.
21:41@greggirwin sometimes experiences a hard reset in his design thoughts ;)
21:43But it's a good note that part func should support negative length too.
Oldes
21:44Where is the part func proposal?
hiiamboris
21:44Unfortunately, looks like Nenad didn't get the point of it, so it's going to just collect dust.
21:44https://github.com/red/REP/issues/97
21:46It's easy to extend it to negatives by defining limit as abs part and skipping back the same amount.
greggirwin
22:56Moving to red/red for my response.

Oldes
13:37I think that the error message is wrong.
>> remove/part (make bitset! "ABC") "AB"
*** Script Error: missing a required argument or refinement
*** Where: remove
*** Near : "AB"
*** Stack:
13:43I believe, that there should be bad-refines: "incompatible or invalid refinements"
13:47Or maybe it could work just like:
>> remove/key (make bitset! "ABC") "AB"
== make bitset! #{000000000000000010}
hiiamboris
13:56I think it should be invalid-arg but agree that the existing message is wrong. There's a ticket about messages.
13:56https://github.com/red/red/issues/4532

Oldes
13:33I noticed, that in Red one can use:
>> rejoin [#{00} [#{01} #{02}]]
== #{000102}

which is nice, but:
>> rejoin ["a" ["b" "c"]]
== "ab c" ;<---- I expected the inner block to be also joined, so have "abc"
13:35Hm... the inner block is just _formed_ and it has same result like in Rebol :/
>> rejoin ["a" ["b" now]]
== "ab now"

13:39Never mind... it is how it should be. At least I like how it works with binary.
ne1uno
13:41Wish rejoin/deep
Oldes
13:41It would slowdown rejoin even more. Looking how complex this mezzanine is, I wonder why I still have such a strong habit to use it.
greggirwin
18:40Probably because concatenation is used a lot. In my 2012 func counts, it's about number 25 in the list by use.

Oldes
16:15Using select/skip in Rebol2 was like:
>> data: [a 1 2 b 3 4]
== [a 1 2 b 3 4]
>> select/skip data 'a 1
== 1
>> select/skip data 'a 3
== [1 2]
>> select/skip data 'b 3
== [3 4]

while in Rebol3 and in Red it is now:
>> select/skip data 'b 3
== 3

Would not it be better to have is same like in R2?
hiiamboris
16:18would be slower if it's a copy
16:19if it's not a copy, then it's find/tail, so pointless
Oldes
16:24But now to have the same result, you must do:
>> either tmp: find/skip/tail data 'a 3 [copy/part tmp 2][none]
== [1 2]
16:28@meijeru https://www.curecode.org/rebol3/ticket.rsp?id=730
16:34I somehow feel, that it should return a block, when skip-size > 2
16:36I think that in R2, when skip-size <= 1, than it works like if there is no /skip and that in R3 the _block selection_ was never done.
hiiamboris
16:37I can't agree. The role of select is to select, not to find. Making yet another special case in the design only to omit one if-expression is not worth it.
16:38either tmp: find/skip/tail data 'a 3 [copy/part tmp 2][none]
is the same thing as
if tmp: find/skip/tail data 'a 3 [copy/part tmp 2]
Oldes
16:39
...
     /skip        => Treat the series as fixed size records.
        size         [integer!] 
...
hiiamboris
16:40So it does. skips the indexes that are not integer multiples.
toomasv
16:41BTW In Red find/skip/tail returns *after the skip*, not after needle as in your example.
hiiamboris
16:42Now that *may* be a bug.
Oldes
16:42Ok.. counted your opinion. I will wait on @greggirwin's input, why it is how it is and why it cannot be changed, because there are no hard data.
16:46So instead of:
select/skip data 'a 3

there must be:
if tmp: find/skip data 'a 3 [copy/part next tmp 2]
hiiamboris
16:49if /tail is final then yes
toomasv
16:57Or
all [tmp: find/skip data 'a 3  copy/part next tmp 2]

Oldes
17:18Yes... there are options, but I wanted to know, if everybody is fine with the current single value result from select/skip
toomasv
17:33It might be good to get the whole record after needle, but I usually need just one element of the record, so there is not much difference between
pick select/skip data 'b 3 2  ;provided /skip returns block

and
pick find/skip data 'b 3 3

except that in first case there is created an additional block.
hiiamboris
17:43and if you need more than one, it's more efficient to access items in place row: find/skip ... row/1 row/2 .. than work with the copy
greggirwin
20:24I need to get some coffee, as this is an oooold topic and no matter what I say will likely contradict at least something I've said about it in the past. :^) But, to @hiiamboris point:

> The role of select is to select, not to find

Yes it is. First find the value, then select what comes after it.

> select: *Find* a value in a series and return the next value, or NONE.
21:39I did a quick search on R2 code, and got about 125 hits on select/skip, roughly discounting dupes by eye. Most common skip value by far is 3. Next is 2. A few used 4. 2 is kind of funny, because it's the same as 1, but returns a block. I imagine this was Carl's clever way of letting you get a single value or a block, but it's a bit odd from a consistency reasoning perspective. I'll come back to this.

That's a good number of uses, which are now broken in Red. I don't know how much it's used in any R3 code, that but that would be good to know. Most important is Red use of course. There it's used 3 times in the Java bridge, and once in help. Lots of tests for it though.

From the above chat we know that the /skip part applies to the value/key/needle you're searching for; what's returned is separate from that.

I haven't searched old altme chat but, coming back to the first para I wrote, I'm confident that the change was made in R3 because using blocks as key-val stores is one of the most common things people do. The catch is that there is no inherent /skip 2 when you do that, for select or path syntax. *This* design chat I do remember coming up at times in R2. Most R2 code is probably OK, but every time path syntax is used, or plain select, it runs the risk of finding the key as part of a record or non-key value. That's bad. I can't be the only one with multiple versions of helper funcs to avoid this problem. I even ported mine to Red.

The reason the change was made in R3, and adopted by Red, is to avoid the double-clock problem. If you have a key-val model, and your vals are blocks, you get this in R2:
>> blks: [a [1 2] b [3 4]]
== [a [1 2] b [3 4]]
>> select/skip blks 'a 2
== [[1 2]]

When what you want is what Red/R3 do:
>> blks: [a [1 2] b [3 4]]
== [a [1 2] b [3 4]]
>> select/skip blks 'a 2
== [1 2]

But that makes you work harder for every other case, outside /skip 2. /only is already used for the key, so we can't even add that to flatten the result. This is a rock and a hard place. It makes perfect sense to return everything in a "record" when you select for its key (the R2 model), but it also makes perfect sense to optimize for the most common use case.

Raw, flat blocks are harder to reason about as records, but more efficient. the CSV codec has an option for just this reason, as it can make a big difference on large datasets. @hiiamboris considers this in his part REP. The idea being that series values could have an internal skip value. But that's beyond this issue for now.

Where flat blocks are used, e.g. CSV, they are less often keyed (guessing a bit here, but also thinking back on my own experience), and are based solely on offset and field count. So select/skip doesn't apply as often.

Given all that, I think the current behavior is best. What we can and should do, of course, is cookbook an example for the alternate case.
gltewalt
21:46/last is not deep. Is that an issue?
21:46
>> select/last [a b c d e f g a h] 'a
== h
>> select/last [a b c d e [f g a h]] 'a
== b

21:50Or should there be a deep? The second example is technically correct since [f g a h] is a different block
greggirwin
21:52There is no deep. Good exercise to think about why. :^)

Oldes
15:57Is read/info supposed to be used with the new IO? Because it has no doc-string now.

greggirwin
02:28Right now it returns full HTTP info [response-code headers content]. Full I/O behavior is TBD.
Oldes
09:47I know what it does.. I wonder if the name of the refinement will be kept.
greggirwin
17:31I don't now what everyone knows. :^) I can't commit to the name being frozen at this time.

Oldes
23:12Wouldn't it be better named read/all instead? So it would be more in sync with load/all?
23:15Although it would be strange to have read/all/part
greggirwin
23:15That's a good name, and existing. What we should do is make sure we know what its purpose is for types that support it.
23:16/all is better for what it returns now, I agree. Because it's not just HEAD for HTTP.
Oldes
23:21Hm.. I think read/all is better than read/info.. because for example in case of error, it returns the error html content page too.. and not just error. Which is useful.

endo64
16:10I remember select/skip discussion with Carl on Altme, but don't remember the conclusion :)
b: new-line/skip [a b c d e f g h i] on 3
>> select/skip probe b 'd 3
[
    a b c
    d e f
    g h i
]
== [e f]

If we treat series as a record then I want to get the selected part which is e and f.
Otherwise I just use find.
16:10[![image.png](https://files.gitter.im/5902e8c1d73408ce4f5b94ba/4oqF/thumb/image.png)](https://files.gitter.im/5902e8c1d73408ce4f5b94ba/4oqF/image.png)
hiiamboris
16:21What if your key is in 2nd or 3rd column?
endo64
16:22You need to organize your data then.
hiiamboris
16:23Nope. Sometimes you use different columns as keys. E.g. reactivity.red
16:24You can just use maps with block values if your data is organized, and key is in 1st column.
endo64
16:26select/skip probe b [d e] 3 ; == [f g] on R2, which I think it should be [f]
16:27Here I found the discussion: http://www.rebol.net/cgi-bin/r3blog.r?view=0194#comments
hiiamboris
16:35Zero arguments in that, only momentary preferences.
Well, anyway GC pressure of this design would render select near-useless for anything but console tinkering.
16:36Plus, every select-using function will have to split it's logic based on /skip size.
16:36Plus, everyone will have to keep this quirk in their minds.
16:37Horrible idea :)
greggirwin
18:06> GC pressure of this design would render select near-useless for anything but console tinkering.

Or people would still write a lot of useful code, completely ignorant of what happens behind the scenes. Fewer people would optimize beyond that, by choice or need. That's what I think would happen.

Oldes
13:34There is not much info in the [Altme chat](http://www.rebol.org/aga-display-posts.r?offset=0&post=r3wp453x13747) either. But it looks that years ago the preferences were to have R2 behavior.
13:36It's a shame that we don't know Carl's opinion... as many times he asked a question and that was all.
13:46And after checking my old code... I used select/skip only with length = 2 (mostly because there was no map! type for key-value pairs in Rebol2)
14:09Also in 1238 scripts from rebol.org there is only select/skip with 2.
endo64
19:16Thanks for the info @Oldes

zentrog:matrix.org
01:07I'm not clear whether this is a bug or by design. I'm trying to select with a path! to get at a nested value.
>> select [a: [b: 123]] 'a/b
== none

I thought maybe it's because select is looking for a literal path!, but these didn't confirm that suspicion either...
>> select [a: [b: 123] a/b 456] 'a/b
== none
toomasv
04:40For last one use /only. But select does not go deep: *"Find a value in a series and return the next value, or NONE"*
08:31Path without /only works same as block:
>> select [a: b: 123 a/b 456] [a b]
== 123
>> select [a: b: 123 a/b 456] 'a/b
== 123

But:
>> select/only [a: b: 123 a/b 456] 'a/b
== 456
>> select/only [[a: b:] 123 a/b 456] [a: b:]
== 123
>> select/only [[a: b:] 123 a/b 456] [a b]
== 123
08:54Extension :)
select*: function [blk key /only][case [
    only [select/only blk key] 
    path? key [foreach k key [blk: select/only blk k]] 
    true [select blk key]
]]
select* [a: [b: 123] a/b 456] 'a/b
;== 123
select*/only [a: [b: 123] a/b 456] 'a/b
;== 456
select*/only [[a: b:] 123 a/b 456] [a b]
;== 123
select* [a: b: 123 a/b 456] [a b]
;== 123
select* [a: [b: 123] a/b [c 456]] to-path [a/b c]
;== 456
>> select* [a: [b: [c: [x y z d 123]]] a/b [c 456]] 'a/b/c/d
== 123
select* [a: [b: [c: [x y z d 123]]] a/b [c/d 456]] to-path [a/b c/d]
== 456
09:25Better just
select-path: function [blk key [path!]][foreach k key [blk: select/only blk k]]
gurzgri
09:49Is this a known lexer bug? transcode "1.79769313486232e308" (or typing 1.79769313486232e308 in the console) hangs Red 0.6.4 for Windows built 19-Feb-2022/3:17:54+01:00 commit #abb5641.
hiiamboris
10:29nope, pls report it
gurzgri
10:42will do

zentrog:matrix.org
07:53toomasv (Toomas Vooglaid): Thanks! That is pretty nice. I was trying to construct a new path and do it, but hadn’t gotten that working yet
toomasv
09:13@zentrog:matrix.org You are welcome!

loziniak
11:59
>> type? load "[test"
*** Syntax Error: (line 1) missing ] at [test
*** Where: transcode
*** Stack: load  

>> type? load-json "[test"
== error!

How do you think, is consistency important here? If yes, should load return error, or load-json should cause error instead?
hiiamboris
12:02load-json should cause error instead
12:03though Gregg disagreed with this IIRC
greggirwin
18:50We need to think about it for all codecs, and other modules as well. CSV causes an error in one case, but returns them in the rest. JSON returns it for a top level problem, but unescape is now a routine that fires an error. XML has a lot of do make error! calls. @rebolek, is there a reason you don't use cause-error?

Error handling choices are always fun. And by "fun" I mean the other thing. :^) There is no single right or wrong here. Consistency is a good thing, but also not universal. This is one of a things I've seen a lot written about in the Java space. If you decide on exceptions (caused/fired/thrown errors), that ripples up to the top of the app that may crash. As you start building levels and layers in apps, each layer has to handle them. In Java this is painful because exceptions are typed, meaning the caller has to handle every specific type of error you may throw in some way, or default to a general handler, which abdicates some responsibility.

In Red, people may eventually build large, layered apps, but for us that issue is much more about libraries. Consistency in the ecosystem will help everyone, but again, we can use too broad a brush. No easy answers.

So let's think about Red's strengths, and how that plays into this. Consider IPC, distributed systems, logging failures, event streams, messaging, HOFs, and more. We may *not* have a single standard model for error handling.

We can chat in red/red and extract thoughts to https://github.com/red/red/wiki/%5BDOC%5D-Error-handling, or people can add their own thoughts directly there (with self-attribution so we know whose thoughts they are).
hiiamboris
18:58> Consider IPC, distributed systems, logging failures, event streams, messaging, HOFs, and more. We may not have a single standard model for error handling.

I honestly don't understand why we should consider any of that. The only thing we should consider here is whether user has to write if error? data: load-json or if error? try [data: load-json ..]. And answer here is clear as it comes down to what user gets if he omits if error?: a clear error from the JSON codec or something like error! type is not allowed here.
greggirwin
19:11> The only thing we should consider here is whether user has to write...

If that were the case, and easily agreed on as clearly superior, wouldn't all languages use the same mechanism at this point?
19:12In some ways it's like the distinction between assertions and errors.
19:15> And answer here is clear as it comes down to what user gets if he omits if error?

Who is the user? The one writing directly against a call? The person using the library the first one wrote? The front end dev who uses the wrapper and doesn't know that they need to use try, so their app crashes?
19:16Believe me, I'll be *thrilled* if we can find an easy answer to this that everyone agrees on and works universally.
hiiamboris
19:17I don't really care about those languages. E.g. in C you have to put an error check after *every* call, which seems nonsensical but has two reasons: exceptions are slower (if you wrap every call in a try that is, but if you just use a reasonable number of tryes then it may even easily be a win), and exceptions were invented much later than C.
D already throws everywhere by default.
19:17> The front end dev who uses the wrapper and doesn't know that they need to use try, so their app crashes?

But app crashes either way
greggirwin
19:22> But app crashes either way

view [a: area 600x480 button "Load" [a/text: form load %fail2.json]]
hiiamboris
19:23counter-example:
view [a: area 600x480 button "Load" [a/text: do make error! "fail2.json"]]
19:24Basically throw or not comes down to two programming paradigms:
1. (old) Meticulously check results at every step and provide error message for every occasion
2. (modern) Divide code into more broad blocks and provide messages for every block failure
19:26Well, there's 3 (ultramodern) - Do not provide any messages and say "something went wrong" on every failure :)
19:27let's not consider it though
greggirwin
19:32In your counter-example, it's a more silent failure, yes? I had to test. :^)

Anyway, wrong room to continue the design chat on this.

To get back on topic, do new GUI consoles not let you select with the mouse, after at least one evaluation, unless you go down a line, for anyone else?
hiiamboris
19:36broken for me too
greggirwin
19:36Thanks. :+1:

rebolek
06:43@greggirwin
> is there a reason you don't use cause-error?

Yes, it’s a confusing function without documentation.
06:43> CSV causes an error in one case, but returns them in the rest.
06:44t should cause them in all cases, I’ll fix that.
greggirwin
18:36> it’s a confusing function without documentation.

We should address that then. Making errors can be a bit tricky, and we should outline best practices.

Don't change CSV just now, as we have so many other tasks pending. Let's sync everybody up on general error handling models and guidelines, and write that up.
hiiamboris
18:53I agree with Bolek that cause-error is quite low level. Preferred way should be the #error macro in most cases.

Error catalog is designed for R/S code that uses it extensively, and cause-error is just a Red wrapper for that.

In Red code, benefit of cause-error is that by using error catalog you don't have to duplicate the same message all over. And also your compiled code also doesn't have to include extra error message strings. So it makes sense to wrap it in *some* contexts.

In general though, errors are often unique, and if we use cause-error in place of clear to-the-point error messages we forfeit important clues and waste our and everybody's time in the end.
18:53It *can* still be used as alias to do make error!, but it's a bulkier alias in this case.
18:56cause-error 'user 'message "error text" vs do make error! "error text"
greggirwin
20:44For me the issue is clarity of intent. do make error! makes you think a lot more. At least it does me.
20:54One downside to #error is the lack of an active verb in the name, so it looks like a definition more than an action.

I have similar naming issues about do/cause/fire/throw/... in the error domain as with all the variants of append/extend/rejoin/reform/join/ajoin/combine/merge in string and structure building.
hiiamboris
21:08I proposed a few alternative names [here](https://github.com/hiiamboris/red-formatting/discussions/20#discussioncomment-2210811), but I would still choose #error
21:09Besides, that's far from the only name that is not canonical in Red
21:16E.g. math, layout, what
21:17I agree would be nice to have a verb, but is e.g. #err better?
greggirwin
21:26We're on the same page. Also in how we can condense the most common patterns when it comes to string output, including interpolation and errors. Math is probably best suited as an optional piece. It's a nice example to have included, also so small that it seems silly to break it out. OTOH, it's also limited in scope and math is a very broad term. And handy if people want to expose math expressions to end users. They shouldn't have to know about Red's internals. do-math or eval-math at least verbify it.
hiiamboris
21:26#fail would probably be my next fav after #error
greggirwin
21:27Layout is interesting, because it is a verb as well as a noun, and so works very well mapped to a declarative dialect.
hiiamboris
21:27shouldn't be lay-out as a verb?
greggirwin
21:28I never liked what.
21:28> shouldn't be lay-out as a verb?

It's an imperfect world. :^)
hiiamboris
21:36If we switch to emojis, no more verb/noun issues ;)
greggirwin
21:37I think you mean *more* issues. :^)
hiiamboris
21:39Of other type, yes ;)

zentrog:matrix.org
01:28complain is cute, but kind of informal or something. I seem to remember that appearing somewhere else. Does what need to be a global value? Maybe it could be folded into help. It seems like it doesn't have a clear role distinct from help. For instance, either returning a value, _or_ printing results (and maybe printing and returning). I think it would have more utility if it just returned results. And why does it reuse the same output buffer?
02:42I also found cause-error extremely confusing. There is no indication what type or id are used for. And when you intercept an error, it's not super clear what you are supposed to do with it either...
>> probe try [do make error! "ack"]
make error! [
    code: 800
    type: 'user
    id: 'message
    arg1: "ack"
    arg2: none
    arg3: none
    near: none
    where: 'do
    stack: 75580124
]

where is nice, but most other languages would call that the stack. So what is this stack for? If you just want to present the message to the user, do you just show them arg1? What are the other args for?
I'm not actually asking for answers to these questions, just talking about the thought process.
greggirwin
06:45- What we simply inherited from Rebol, but changing it doesn't break anything beyond unlearning it. I doubt it's used much anyway (I know I don't), because the information isn't presented in a terribly useful way.

- cause-error needs improvement, so I'll ping Nenad on that. Just let him know we're talking about it and may propose something better.

- Where vs stack is interesting, and I believe it's OK in the context of Red being data centric, including "code". The new interpreter instrumentation, and @hiiamboris 's improvements on the mezz wrappers are great. Another case of needing to outline guidelines for people as an important step.
rebolek
08:14Thinking about cause-error a bit more: As CSV is part of the main distro, probably it shouldn’ throw user error but its error should be added to error catalog. Then cause-error would make sense using.
gltewalt:matrix.org
15:03Use this
15:03[40f.png](https://gitter.ems.host/_matrix/media/v1/download/matrix.org/wlzEtivqeYyVPesMhfKgxDlH)
greggirwin
17:31Moving to red/red.

endo64
08:15> > its error should be added to error catalog

I agree on that, currently we have throw, note, syntax, script, math, access, reserved1, reserved2, user, internal in SYSTEM/CATALOG/ERRORS, we might have codec or data for JSON, CSV, XML codecs.

rebolek
08:26
>> c: context [a: 1]
== make object! [
    a: 1
]
>> c/b: 1
>> c
== make object! [
    a: 1
]


I am setting a value not present in the context. Red happily accepts it, even if it can’t set it. I would expect an error in such a case.
toomasv
09:07Seems to be regression introduced sometime around June/July last year.
rebolek
09:11Thanks, I’ll open a ticket for it.
greggirwin
22:37Good catch!

hiiamboris
11:22> Thanks, I’ll open a ticket for it.

@rebolek forgot? ;)
rebolek
16:37@hiiamboris Yup, totally :) It was a byproduct of working on IO and I focused on it again.
16:47Done https://github.com/red/red/issues/5101
hiiamboris
16:49:+1:

mikeyaunish
21:09Can't seem to catch this font-size 0 error.

Red 0.6.4 for Windows built 10-Mar-2022/17:40:53-06:00 commit #27f71f9
view [
    button "layout with font-size 0" [
        the-vid-code: [base1: base "HELLO" font-color white font-size 0]
        either error? err: try/all [
            output-panel/pane: layout/only the-vid-code 
            true
        ][
            print "error"
        ][
            print "no-error"
        ]
    ]
    output-panel: panel 400x400
]

attempt didn't seem to catch it either.
hiiamboris
21:15confirmed: base "x" font-size 0 crashes
21:15pls create an issue
mikeyaunish
22:39@hiiamboris OK - thanks.

greggirwin
01:14Thanks @mikeyaunish. :+1:

loziniak
02:11Hello. On my Manjaro Linux machine I get a core dumped when executing any script by console compiled by echo 'Rebol[] do/args %red.r "-d -r --no-view %environment/console/CLI/console.red"' | rebol +q -s from latest master.
02:12Example script:
Red []
print "test"
02:14Can anyone confirm?
02:21There is no problem when running scripts from toolchain build *10-Mar-2022*
hiiamboris
16:51no issue on ubuntu
16:51
>> about
Red 0.6.4 for Linux built 17-Mar-2022/9:27:47
16:52ah wait, I need a script
16:53no, still no issue
loziniak
17:32I tracked down the error, it's introduced in commit af98e79db717134b924160101f8a1e75566aa575 "FIX: partial fix for #5094."
hiiamboris
17:36hmm seems I forgot to pull, so on 11 Mar commit now
17:36let me test on current
17:39yes, segfaults on ubuntu too, after the script is executed
17:39please add a note on that commit
loziniak
17:45ok, sure. thanks for checking

GiuseppeChillemi
11:24One of the most recent Red Version console, does not let me select the output of a commands. Has this bug appeared here?
hiiamboris

rebolek
07:44Try typing this in console: [http://test.com]. When I press Enter, Red opens a block for me. I must type space before the closing bracket to get this input accepted.
toomasv
08:24Seems OK on W10.
rebolek
08:39I tested it with master branch and it’s fine. This happens on IO branch only. Probably some master branch fixes are not merged in.
dsunanda
17:15 8-bit arithmetic dept: is this expected?
#"a" - #"b"
*** Math Error: math or number overflow

0 + #"a" - #"b"
== -1
hiiamboris
17:19it's not 8-bit, it's because char! codepoint cannot be negative
17:19same for tuples, but they are silent

Oldes
11:11It should return -1 imho instead of the error.
11:21In R3 it is:
>> #"b" - #"a" 
== 1
>> #"a" - #"b" 
== -1

But also:
>> #"a" + #"b" 
== #"Ã"

Which I'm not sure if should not be also an integer instead (but I don't care).
11:23Anyway.. for the subtraction the result is always an offset, which is the most useful result.
hiiamboris
11:49does R3 also auto expand integer on overflow?
dsunanda
14:14
#"a" - #"b"

R2 returns 255, Atronix R3 returns -1, Red errors .... Between the dialects, it looks like every defensible option is catered for :)
Oldes
14:50What is wrong with the offset between 2 chars? 255 does not make sense when the char is now 32bit
hiiamboris
15:44-1 seems most useful, but has to be consistent with integers IMO
greggirwin
17:55> for the subtraction the result is always an offset, which is the most useful result.

What makes it most useful? I understand ASCII casing offsets, but that's a very narrow...case. For me it feels odd that arithmetic on matching types produces a different type.

The Red behavior is by design and [documented](https://github.com/red/docs/blob/master/en/datatypes/char.adoc#arithmetic) but can be changed if it leads to a more consistent and reasonable design. I'm not against removing the error in this case, and we do want to maximize leverage. But we also want to make sure types have consistent and appropriate behavior in their domain.
hiiamboris
18:40> For me it feels odd that arithmetic on matching types produces a different type.

>> 2/2/2 - 1/1/1
== 397
greggirwin
21:36That one I'm normalized to. :^) And why I said it needed to be appropriate to the domain of the type. Returning offsets for chars probably *is* the best option, and worth thinking about how negative offsets might be used. What are the cases?
hiiamboris
21:39my use case is eliminating boring errors [like this](https://gitlab.com/hiiamboris/red-mezz-warehouse/-/blob/master/tracing.md#tracing-sub-expressions-with-traceall)
greggirwin
21:451) Has anyone ever hit this error in production code? 2) Since it returns an integer offset, we can justify it not erroring out. It doesn't error on 32 - #"a", which is a case for consistency.
hiiamboris
21:46do we have "production code" in Red? ;)
21:47that was not a made up example if that's what you mean
21:48still I'm not convinced myself we're shuffling things a better way here
21:48if anyone has strong argumentation for the change, open a REP pls
greggirwin
21:51:+1:

hiiamboris
16:35I recall someone posted a link to a page with assumptions about time... One of that was "time is always monotonic", lol:
>> loop 10000 [t: dt [loop 1000 []] if t < 0 [probe t]]
-0:00:00.0001707
-0:00:00.0005066
-0:00:00.0003257
-0:00:00.0003281
-0:00:00.0003163
-0:00:00.0004959
== none
16:35Only reproducible on Windows.
18:00must be some math error in get-time
greggirwin
19:10Lamport clocks. :^)

GiuseppeChillemi
14:13Wow, time machine exists!
dsunanda
14:31@GiuseppeChillemi Clock-independent timing loops were an integral part of the VTOS operating system that was built in the 1980s to support the BABBAGE language. Windows has clearly inherited some of the design goals.
http://www.tlc-systems.com/babbage.htm
hiiamboris
15:24> Wow, time machine exists!

Brain is a time machine ;) [We know the future before it happens](https://www.spiritualityhealth.com/articles/2012/01/27/science-premonitions)
15:25No wonder Red learned that as well :D
pekr
15:35@hiiamboris with your negative time measures, we have finally got ultra fast timers, so we can compete with the LibEvent, LibUV, etc event loops :-) https://stackoverflow.com/questions/9433864/whats-the-difference-between-libev-and-libevent
hiiamboris

GiuseppeChillemi
22:01Is this correct?
>> y: [none none!]
>> quote none = pick y 1

** Script Error: = operator is missing an argument
*** Where: catch
*** Near : = pick y 1
*** Stack:
greggirwin
22:15Yes.
>> quote none
== none

>> = pick y 1
*** Script Error: = operator is missing an argument
*** Where: catch
*** Near : = pick y 1
*** Stack:
22:16
>> 'none = pick y 1
== true
>> #[none] = pick y 2
== false
>> 'none! = pick y 2
== true
GiuseppeChillemi
22:20Wow, I didn't know about 'none
greggirwin
22:20It's just a lit-word! like any other.
GiuseppeChillemi
22:25The more I think I know, the more I know I don't know.
22:27Also, it is starting to be late.... I have forgotten that as Red priorities work, that phrase is read as:
quote (none = pick) y 1
22:28I must quit and go to sleep, I am doing the usual late night errors you know.
greggirwin
gurzgri
23:23I don't think that is how it is evaluated by the do dialect, see
>> do/next [quote none = pick y 1] 'step
== none
>> step
== [= pick y 1]
>> do step
*** Script Error: = operator is missing an argument

Have a look into the spec-of :quote to see how that is defined and why therefore your line is explicitly not evaluated the way you assume.
23:33(none = pick) would itself raise an error, because then pick would be missing it's arguments. If any, then quote (none = pick y 1)quote (none = 'none)quote false (with the parens only for explicitly demonstrating alledged evaluation order), but as shown: no, not in this order.
23:40Therefore, I'm a bit puzzled too because of
>> quote none = pick y 1
*** Script Error: = operator is missing an argument
>> (quote none) = pick y 1
== true
greggirwin
23:48https://github.com/red/red/issues/3179 and a couple other related tickets come into play here, because quote uses a get-arg.

hiiamboris
15:09It's an optimization as I understand it. Esoteric use case not worthy of slowing down the interpreter with it.
15:13Some more esoteric cases can be found here: https://github.com/red/red/issues/941
gurzgri
15:21Okay then, with much emphasis on "okay" :J I'm all against esoteric cases, but was just curious.
Oldes
21:32
>> mold to url! "http://aa/bb[]cc"
== "http://aa/bb%5B%5Dcc" ;<--- OK
>> mold to url! "http://aa/bb()cc"
== "http://aa/bb()cc" ;<--- WRONG, it should be: "http://aa/bb%28%29cc"

hiiamboris
21:54https://github.com/red/REP/issues/112
21:55see trailing comments

Oldes
22:12
>> %"aa:bb"
== %aa:bb ;<=== not backwards loadable
>> load {%aa:bb}
== [%aa :bb] ;<=== two values
greggirwin
22:36Good catch @Oldes. Please report it.
hiiamboris
22:49https://github.com/red/red/issues/4060
greggirwin
22:50Ah, thanks.

bubnenkoff
07:06I have found a bug:
>> out: copy []
== []
>> loop 10000 [collect/into [keep [[a: 1]] ] out] 
== [[a: 1] [a: 1] [a: 1] [a: 1] [a: 1] [a: 1] [a: 1] [a: 1] [a: 1] [a: 1] [a: 1] [a: 1] [a: 1] [a: 1] [a: 1...
>> ; probe out
>> 
>> 
>> unique out
*** Internal Error: stack overflow
*** Where: unique
*** Near : out
*** Stack:
gurzgri
08:57Have you realized that you're inserting 10'000 times the exact same block [a: 1]? Just to make sure. Then there is no need to 10'000 times collect, you can often use it only once as an outer "bracket". And then there is keep/only to insert blocks as blocks:
>> out: collect [loop 10000 [keep/only [a: 1]]]


However, the problem you encoutered with unique remains. It happens with most any-block! types but interestingly doesn't happen for map!:
>> unique collect [loop 10000 [keep/only [a: 1]]] ;*** Internal Error: stack overflow
>> unique collect [loop 10000 [keep/only quote (a: 1)]] ;*** Internal Error: stack overflow
>> unique collect [loop 10000 [keep/only quote a/b]] ;*** Internal Error: stack overflow
>> unique collect [loop 10000 [keep/only quote :a/b]] ;*** Internal Error: stack overflow
>> unique collect [loop 10000 [keep/only quote a/b:]] ;*** Internal Error: stack overflow
>> unique collect [loop 10000 [keep/only #(a: 1)]]
== [#(
    a: 1
)]
hiiamboris
09:00Please create a ticket @bubnenkoff
bubnenkoff
09:02> Have you realized that you're inserting 10'000 times the exact same block [a: 1]? Just to make sure.
Yes, I inserted same block on purpose

@hiiamboris ok
gurzgri
09:03Good then :J
bubnenkoff
09:08done https://github.com/red/red/issues/5123
hiiamboris
09:45thanks

ALANVF
20:06found a nice View bug where attempting to use return center between widgets causes a syntax error. I'm sure that bugs exist for other attributes as well
hiiamboris
20:11why should it not be a syntax error?
ALANVF
20:12the docs say that it's allowed
20:12https://github.com/red/docs/blob/master/en/vid.adoc#43-return
20:12either the docs are wrong or Red is wrong
20:12(in which case, I'll move this to red/docs)
hiiamboris
greggirwin
20:13Question of whether it's just docs that are wrong. This example from an old blog entry makes me think docs just copied some bits they shouldn't.
view [
        style chk: check "Option" data yes
        style vline: base 2x60 red
        across top    vline button "Ok" text "Text" field chk return
        across middle vline button "Ok" text "Text" field chk return
        across bottom vline button "Ok" text "Text" field chk
    ]

But the docs aren't just copied from other direction commands. @qtxie any thoughts?
hiiamboris
20:14@ALANVF I think it's a docs problem, since return accepts either new row with middle/top/bottom or new column with center/left/right, but when you mismatch these you get the error
greggirwin
20:14We need examples directly in docs, or at least links to them. I know that has its own issues, but when we don't know who to trust, it's bad.
20:14Good quick R&D @hiiamboris.
hiiamboris
20:15I just recalled it from my previous layout work :)
greggirwin
20:19Pffft. Too easy. ;^)
20:19@ALANVF please R&D it and make an example if you would.
ALANVF
20:26sure
20:31doesn't crash in this specific example, but return doesn't do anything either (I am still learning VID)
view [ below text "a" return center below text "b" ]
20:32oh I should look up what R&D actually means
20:32ahhh ignore that then
greggirwin
20:56Interactive R&D. "I tried this..." :^)
20:56I do that, because I can't keep everything in my head like @hiiamboris and some others.
ALANVF
20:59ah, I usually just keep like a text/markdown file for stuff like that lol

ALANVF
22:54pog found a new crash:
o: make object! [ f: does [self] ]
context? first body-of :o/f
22:54I'm not sure why it crashes though

greggirwin
00:24There are a few self-related tickets out there. If you can't find this one, please add it.
ALANVF
00:25do you think it's related to #4552?
greggirwin
00:29Looks like it. And something good to note as @dockimbel said something about redbin having issues with objects IIRC.
ALANVF
greggirwin
00:29Add a note to that ticket.

dsunanda
16:57I can't get compile option -e to work under Windows --- it appears to not understand that #includes may be in sub-folders. This code can create the conditions to test (you need to change the name of the Red executable in the two .BAT files):
;; create sub-programs
attempt [make-dir %utility-scripts]
write %utility-scripts/math.red "Red []^/^/halt"
write %utility-scripts/gui.red  "Red []^/^/halt"


  ;; create main program
write %test.red {
Red [needs: View]

#include %utility-scripts/math.red
#include %utility-scripts/gui.red
halt
}


   ;; compile with -e
write %compile-test-with-e.bat {
echo on
red-2022-05-17 -r -e -t windows test.red 
pause
}


   ;; compile without -e
write %compile-test-without-e.bat {
echo on
red-2022-05-17 -r -t windows test.red 
pause
}
16:58Attempt to compile with -e gets:
*** Compilation Error: include file not found: utility-scripts/gui.red

Without -e, I get a correctly compiled .exe, as expected.
hiiamboris
17:10a long known bug
17:11solution: https://gitlab.com/hiiamboris/red-cli/-/tree/master/mockups/inline
dsunanda
17:23@hiiamboris Thanks. Any idea when it might be fixed? My actual nest of scripts contains a script that won't compile without -e .... So, right now, the app is undeployable.
hiiamboris
17:33no idea
17:33I'm just using inline

dsunanda
07:08@hiiamboris Thanks. inline looks useful for overcoming the brokenness of -e.
But, basically, the whole compiling model is, at the very least, looks due for a rethink if -e is even necessary.
Essentially, right now, compiling is useless for anything beyond a moderate level of complexity.
hiiamboris
08:17True.

Oldes
13:45Is this ok?
>> to-integer "3.4E+2"
== 3 ;<==  is 340 in R2 and R3
hiiamboris
13:47I think it should be as it is
13:48for speed and less surprises
ALANVF
21:11I personally find that pretty surprising
hiiamboris
21:23well, since it fails on many other invalid inputs, an error would be preferable
21:24or it should stably eat as many digits as it can
21:25right now it's result is just implementation dependent gray zone
21:30this is clearly a bug:
>> to integer! "3.4e2"
== 3
>> to integer! "3e2"
*** Script Error: cannot MAKE/TO integer! from: "3e2"
*** Where: to
*** Near : "3e2"
*** Stack:
ALANVF
21:30that actually seems intentional to me?
hiiamboris
21:30how so?
ALANVF
21:31integer parsing is often defined so that you can successfully parse the beginning of a string, but not all of it
21:31. is a common punctuation, so once it's encountered the parser stops
hiiamboris
21:32agreed, but then:
>> to integer! "3x2"
*** Script Error: cannot MAKE/TO integer! from: "3x2"
*** Where: to
*** Near : "3x2"
*** Stack:  

>> to integer! "3 inches"
*** Script Error: cannot MAKE/TO integer! from: "3 inches"
*** Where: to
*** Near : "3 inches"
*** Stack:

so it totally doesn't work as I thought
ALANVF
21:32but a letter is seen as a parsing error, because of course letters aren't separators
21:32that just makes it seems more intentional
21:32possibly even for this exact use case
hiiamboris
21:32for extracting integers only from floats that have a period?
21:32hardly
ALANVF
21:33yeah, or more simply, extracting an integer from a float input
hiiamboris
21:35@ALANVF if you're willing to open an issue report and describe what R2/R3 does and possible use cases and drawbacks of both loading (as in rebol) and simple forgiving integer extraction, that would be welcome
21:36whether it should understand ' delimiter is also questionable
ALANVF
21:36well I'm kinda torn between returning 340 and throwing an error
hiiamboris
21:37of course, that's why we need a ticket to collect input and design ideas
ALANVF
hiiamboris
21:38:+1:
ALANVF
21:53@hiiamboris #5147
21:53I'm not great at writing, but that should be a good description of the issue
hiiamboris
22:03thanks

gurzgri
16:01Is it to be expected that a script as simple as
Red [] #system [memory-stats 3]


compiled with do/args %red.r "--release --debug %memtest.red" fails with
PS C:\Users\Christian Ensel\Development\red-master> .\memtest.exe

====== Red Memory Stats ======

-- Node frames --
#1: used = 10000/10000 (100%), free = 0/10000 (0%)
#2: used = 424/10000 (4%), free = 9576/10000 (96%)

    2 frames

-- Series frames --
#1: used = 1048520/1048576 (99%), free = 56/1048576 (1%)
 - 05450014: size = 64000, offset pos = 0, tail pos = 25568    T
 - 0545FA28: size = 53491844, offset pos = -88472092, tail pos = 4

*** Runtime Error 98: assertion failed
*** in file: /C/Users/Christian Ensel/Development/red-master/runtime/debug-tools.reds
*** at line: 194
***
***   stack: red/list-series-buffers 05450004h
***   stack: red/memory-stats 3


(this is with a freshly cloned Red 0.6.4 for Windows built 11-Jun-2022/15:58:04)? I expected that to work.
hiiamboris
16:08I guess just nobody used memory-stats in a while?
16:09raise an issue, I'm sure it was never reported
gurzgri
16:28[#5150](https://github.com/red/red/issues/5150)

dsunanda
11:49I am trying to convert an old Rebol system which has run rock-solid for at least 15 years. The Red port of it will crash after about an hour's usage. The problem seems to be running out of memory after displaying around 2000 images - even though only one is on screen at any one time.
My high score for the code below is around 950 loops before crash. The code is under Windows 10. I really need a high score of at least 10,000 to have a viable application:
11:49
;; Create a couple of fairly small images:
im-1: to-image view/no-wait compose [box 500x500 red (copy/part mold system 4000 )]
im-2: to-image view/no-wait compose [box 400x400 blue (copy/part mold system 2000)]
save/as %image-1.jpg im-1 'jpeg
save/as %image-2.jpg im-2 'jpeg
unview/all

view/no-wait [im: image 200x200 count: text 100x50]
recycle/on       
try [delete %log-file.txt]
n: 0
     ;; swap between the images until failure:
loop 5000 [
   n: n + 1
   count/text: rejoin [form n " " stats]
   im/image: load/as %image-1.jpg 'jpeg
   im/image: load/as %image-2.jpg 'jpeg
   write/lines/append %log-file.txt count/text
   recycle
   ]
print "worked this time"   ;; be nice to see this message :)

hiiamboris
11:51images are not collected
11:52you can use this very old branch for your task https://github.com/red/red/pull/4662
11:52it's still GDI backed
dsunanda
11:52So basically, Red's View is a GUI with no images!? Can that be fixed?
hiiamboris
11:53why with no images? a few will work fine, you just can't spawn a lot
dsunanda
11:55Thanks for the comments and info .... My issue is the application is a membership database that shows the member's headshot. So spawning one image per person is kinda the minimum expected of it.
hiiamboris
12:03well...
12:04are you using ODBC branch then?
dsunanda
12:18No - just the latest nightly. (Handling the DB side without ODBC is story for another time :)
hiiamboris
12:25then that old branch might still be an option
dsunanda
12:38I'll take a look ..... But it seems unlikely as I have had bugs in the official 0.6.4 release - which is of a similar age.
Right now, it looks like Red is not an appropriate choice if the app needs to display more than 100 images (depending on size), even if just one at a time.
hiiamboris
12:46Gregg will come and say that our coffee machine is not smart enough :)
12:47But we have an old coffee machine which is noisy but was able to clean the glasses ;)
dsunanda
13:14:) But the slowly growing problem with the Rebol app is that it is accumulating cruft - eg things like 'browse doesn't work properly any more.

So I'd like to replace it with something that isn't aleady years old, and hard to update .... So a spun-off branch is not that attractive :)
hiiamboris
16:35Sure, but your best bet for now, given what we have

loziniak
12:33
$ ./red-16jun22-15b93aff8 
Gtk-Message: 14:32:15.045: Failed to load module "xapp-gtk3-module"
Gtk-Message: 14:32:15.045: Failed to load module "xapp-gtk3-module"
--== Red 0.6.4 ==-- 
Type HELP for starting information. 

>> system/build/date
== 24-Jun-2022/12:28:44


Perhaps worth checking?
12:33downloaded from https://www.red-lang.org/p/download.html
greggirwin
13:51Do you have 32-bit libs installed? That's the first issue people usually hit.
13:51And is it only the new build that errors?
GiuseppeChillemi
15:40I see port? not implemented into RED while PORT! is, it is correct?
15:41(Tested on RED-ODBC)
gurzgri
16:03can confirm, noticed that too, probably waits for i/o branch or so.
GiuseppeChillemi
17:22This works:

f1: func [/local data1 data2] [
   data1: "hello" data2: none
    f2 words-of context? 'data1 ;<--------- The difference is here
   	reduce [data1 data2]
   ]
f2: func [ctx] [
   set next ctx reduce [uppercase get ctx/2 " world!"] ;next avoids /local
   "DUMMY RETURN"
]


>> f1
["HELLO" " world!"]
>>


This eats the stack:

f1: func [/local data1 data2] [
   data1: "hello" data2: none
    f2 context? 'data1 ;<--------- The difference is here
   	reduce [data1 data2]
   ]
f2: func [ctx] [
	 ctx: words-of ctx;<--------- The difference is here
   set next ctx reduce [uppercase get ctx/2 " world!"] ;next avoids /local
   "DUMMY RETURN"
]

!!!
*** Internal Error: stack overflow
*** Where: data1
*** Near : "hello" data2: none f2 context? 'data1 reduce 
*** Stack: probe f1 f2 words-of f2 words-of f2 words-of f2 words-of f2 words-of f2 words-of f2 words-of f2 words-of 
f2 words-of f2 words-of f2 words-of f2 words-of f2 words-of f2 words-of f2 words-of f2 words-of f2 words-of f2 words
-of f2 words-of f2 words-of f2 words-of f2 words-of f2 words-of f2 words-of f2 words-of f2 words-of f2 words-of f2 w
ords-of f2 words-of f2
17:25Have I done something wrong or could I write a bug report?
Oldes
17:28It's not a bug. ctx in f2 is a function, which calls itself, until the stack's end.
17:29Use ctx: words-of :ctx and it will be ok.
GiuseppeChillemi
17:39Thank you Oldes, to me CTX was just a context, as I have obtained it with context? and not the function itself. Changing it to ctx: words-of :ctx has solved.
Oldes
17:47Even a function may be a context.
GiuseppeChillemi
17:58Yes but I have supposed it would have been more like regular object than an active function.

loziniak
11:22@greggirwin It was not about Gtk-Messages, but build date – it's different than filename. 16 vs 24 Jun.
hiiamboris
11:24happens when there are no new commits

Oldes
10:07Is the try/all functional? It looks that try catches these break, continue, exit, etc. exception any time.
>> error? try [exit]
== true
>> error? try/all [exit]
== true
>>
hiiamboris
11:59
>> ? try
USAGE:
     TRY block

DESCRIPTION: 
     Tries to DO a block and returns its value or an error. 
     TRY is a native! value.

ARGUMENTS:
     block        [block!] 

REFINEMENTS:
     /all         => Catch also BREAK, CONTINUE, RETURN, EXIT and THROW exceptions.
     /keep        => Capture and save the call stack in the error object.
11:59try/all is fine
12:00with try you need a function to use exit, otherwise it's an error indeed
Oldes
12:28I don't see any difference between try and try/all in Red.
12:30In Rebol, which don't have try/all, the try don't catch these exceptions:
>> error? try [1 / 0]
== true

>> error? try [exit]

** Throw error: return or exit not in function
12:34So I think that if there is not some invisible reason, try/all could be removed in Red and Rebol should be able to catch these exceptions by default like Red does.
hiiamboris
12:35
>> do reduce [does [try [return 42]]]
== 42
12:35like I said
Oldes
12:37How it is related to try/all? And you don't have to send help on try. I'm not a newbie!
hiiamboris
12:39sure
12:39
>> do reduce [does [try [return 42]]]
== 42
>> do reduce [does [try/all [return 42]]]
*** Throw Error: return or exit not in function
*** Where: return
*** Near : 42
*** Stack: run eval-command do-command try-do

This clears up the difference?
Oldes
12:52Yes.. that makes sense.
hiiamboris
13:29I agree though, design was too quick. In my experience when you build loops, you want to catch only continue or only break, and get it's argument, and leave the rest untouched. As for exit/return, on the contrary, you want transparency to these, esp. for function body.

Oldes
19:23There seems to be such inconsistency:
>> to-string quote a/b:
== "a/b:" ;<-- keeps decoration
>> to-string quote b:
== "b" ;<-- removes decoration
19:25No difference:
>> form quote a/b:
== "a/b:"
>> mold quote a/b:
== "a/b:"
greggirwin
19:53Listed [here](https://github.com/red/red/wiki/%5BDOC%5D-Table-for-to-string-etc.), but it's a good design question.
19:55That table needs a quick update, as mold/all produces serial syntax for none! and logic! now.
19:57Done.
Oldes
20:00@meijeru do you think that form quote a/b: and to string! quote a/b: should remove the decoration like it is with set-words?
meijeru
20:03Yes, for consistency and ease of remembering, I would think that (lit/set/get)-paths should be treated similar to (lit/set/get)-words by form and to-string.
hiiamboris
20:07agreed
Oldes
20:12I wonder if it should be removed also when used with other string types.. like email!, ref!, url!, tag! etc.?
>> to-url quote a/b:
== a/b:
>> to-url quote a:
== a
hiiamboris
20:24: is ok in urls refs emails tags
20:24but I don't care really
20:24who builds these from words?
Oldes
20:32I would remove it there too for simplicity and consistency. I thing these conversions are there just because some result is better than error anyway.
20:38Also... currently there is:
>> to string! [(a b) [c d] e/f g h]
== "a bc de/fgh"

I think, that "a b c d e/f g h" looks like better result :/
hiiamboris
20:40I would prefer form to form and to-string to call itself
Oldes
20:40Or is there someone using something like:
>> to-string [h e l l o]
== "hello"

?
hiiamboris
20:40
>> form [(a b) [c d] e/f g h]
== "a b c d e/f g h"
20:40then to-string would yield "abcde/fgh"
20:41it's counter-intuitive that to-string calls form on blocks
greggirwin
20:46> it's counter-intuitive that to-string calls form on blocks

Agreed.

Oldes
10:02The escape char ^ behaves strangely when used in file:
>> %^
== %"^"
>> %"^"
== %"""
>> %"""
*** Syntax Error: (line 1) invalid string at "
hiiamboris
10:49Yeah
>> %"^""
*** Syntax Error: (line 1) invalid string at "
*** Where: set
*** Near : token/y
*** Stack: load

inc0n:matrix.org
14:35Hello everyone, I'm on Mac m1, red 0.6.4 from the download page result in "bad CPU type in executable". And I'm also unable to build from source, since it requires a rebol intepreter, which is also bad CPU type. What would my options be for trying out red??
14:35Thanks in advance
ldci
14:50@inc0n:matrix.org .Unfortunately Red is 32-bit only. I’m also on Mac m1 and the only way I found is to install parallel desktop and a windows 64-bit version.
greggirwin
14:50There are some Docker images available as well.
14:51https://github.com/rebolek/red-tools/wiki/Red-on-Catalina

gltewalt
20:53
--== Red 0.6.4 ==-- 
Type HELP for starting information. 

>> system/words/what

*** Runtime Error 1: access violation
*** at: 080943BBh

greggirwin
20:54Reproduced. See if there's a ticket for that.
gltewalt
21:01Not sure exactly what to search for, but so far I don't see one
greggirwin
21:03Open a new one then. Thanks!
21:03Please note that what by itself works fine.
gltewalt
21:04Yeah. And... should I go through each system/words(where applicable) looking for other bombs?
greggirwin
21:05Help, about, and source seem OK.
hiiamboris
21:08compiler's glitch by the looks of it

Oldes
09:49When inserting char! key into a map! it is always case-sensitive... as there is put/case available, I guess that put without /case should be insensitive:
>> m: #() put m #"a" 1 put m #"A" 2 m
== #(
    #"a" 1
    #"A" 2
)
hiiamboris
09:59It's insensitive:
>> m: #()
== #()
>> put m "ab" 'ab
== ab
>> put m "AB" 'AB
== AB
>> m
== #(
    "ab" AB
)
09:59Red just has this char problem:
>> #"a" = #"A"
== false
10:00and you have to form chars to compare
toomasv
10:43Are chars not always case-sensitive in Red? And strings by default case-insensitive.
ldci
10:44
m: #()
put m 1 "ab"
put m 2 "AB"
m

10:44
>> m
== #(
    1 "ab"
    2 "AB"
)

11:40
>> a: "ab"
== "ab"

>> b: "AB"
== "AB"

>> a = b
== true

11:45#"a" = # »A »is also true with R3

GiuseppeChillemi
21:14I have a probable bug

If you use a datatype in a function specs without a block, the function eats and additional argument:

f: func [
			a 
			/b 
			arg-b word! "Should work?" 
			/local
		] [
			
			either b [
				probe a * arg-b
			] [
				probe a
			]
		]



21:14Try:

f/b 2 3


It won't work
21:16But if you try:
f/b 2 3 4


21:18It is executed!
Oldes
21:20Actually it is not a bug... you just made a function, where /b has 2 arguments: arg-b and word!
GiuseppeChillemi
21:21Nice explanation but I don't think it should be allowed ;-)
Oldes
21:21Because:
>> type? first [word!]
== word!
>> type? first [x!]
== word!
21:22The ! is just a convention.
GiuseppeChillemi
21:22Yes, In the last months you have already enlightened me.
Oldes
21:24It is your bug. Just use correct syntax.
GiuseppeChillemi
21:25I won't answer. I have to think about it.
Oldes
21:30
>> f: func[word! [string!]][ probe word! ]
== func [word! [string!]][probe word!]
>> f "a"
"a"
== "a"
>> f 1
*** Script Error: f does not allow integer! for its word! argument
21:31Red (and Rebol) cannot do anything with this... word! and string! are just words like word and string.
21:32It can try to do checks, if you really want word! and not correct [word!], but it would be expensive.
GiuseppeChillemi
21:52No, leave everything as is.
21:52Just we whould add notes to the docs-
22:15Being in the middle of the transition from Rebol to Red, I have discovered interesting things:

In **Rebol2**
probe bound? to-lit-word word!
== none

you get no context from this conversion

You must do
to-lit-word to-word word!

To have a context
While in **Red**
to-lit-word word!


Is sufficient to have a word with a context as result
Oldes
22:21Don't understand what you mean. In Red you do:
>> context? quote word!
== make object! [
GiuseppeChillemi
22:23Try bound? to-lit-word word! in Rebol2
Oldes
22:24And so? It is Rebol2 bug.
>> type? to-lit-word word!
== word! ;<= should be lit-word! like in Rebol3 and Red
GiuseppeChillemi
22:24I have thought it was a difference
22:25However, you should consider this when converting code
22:27> And so? It is Rebol2 bug.
>
rebol
> >> type? to-lit-word word!
> == word! ;<= should be lit-word! like in Rebol3 and Red
>


Funny

greggirwin
18:25@GiuseppeChillemi on func specs, an easy way to see what Red thinks is to use help on the function.
GiuseppeChillemi
20:37If I try to probe all the words of the system context I get an invalid utf-8 encoding: #{A0D0A7FE}

Try:

red-words: words-of system/words

foreach [wordx] red-words [
   probe wordx
]

greggirwin
21:24Works fine here for me.
RED: [ branch: "master" tag: #v0.6.0 ahead: 8140 date: 16-Jun-2022/2:23:20 commit: #15b93aff8e561de22905572ada060699eb3a4146 ]
PLATFORM: [ name: "Windows 10" OS: 'Windows arch: 'x86-64 version: 10.0.0 build: 19044 ]
GiuseppeChillemi
21:25Maybe my italian language windows influences it? I suppose some accented italian strings
21:26Could be date related like lunedì (Monday)

PeterWAWood
10:06I installed the new GUI and CLI console builds on a Raspberry PI running the latest 32-bit OS (Buster) which is fully updated. The cli console runs fine but there is an issue with missing libcrypto.so.1.0.2

pi@Pi4B:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
NAME="Raspbian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
pi@Pi4B:~ $  getconf LONG_BIT
32
pi@Pi4B:~ $ Red/red
--== Red 0.6.4 ==-- 
Type HELP for starting information. 

>> quit
pi@Pi4B:~ $ Red/red-view
Red/red-view: error while loading shared libraries: libcrypto.so.1.0.2: cannot open shared object file: No such file or directory


libcrypto1.1 is installed.

libcrypto.so.1.1 (libc6,hard-float) => /lib/arm-linux-gnueabihf/libcrypto.so.1.1
hiiamboris
11:05was also reported here https://gitter.im/red/red?at=61e693276d9ba23328c9c1b5
11:06symlink is the only solution for now I guess
PeterWAWood
11:30The linked comment reports libcrypto.so.1.1 could not be found. I got a message that libcrypto.so.1.0.2 could not be found when I have 1.1 installed.
hiiamboris
11:38tried symlinking?
dockimbel
13:07Thanks Peter for reporting it. I remember a similar issue on my RPi, I'll have a look to see how I solved it.

PeterWAWood
01:32@hiiamboris @dockimbel Symbolic linking libcrypto.so.1.0.2 to libcrypto.so.1.1 gets Rebol/View console working on an up-to-date 32-bit PiOS Buster system. For the benefit of others trying, this is the command that I used to "symlink" to the installed library.
sudo ln -s /lib/arm-linux-gnueabihf/libcrypto.so.1.1 /lib/libcrypto.so.1.0.2
qtxie
03:06This lib name along with others we used in Red are varies in different Linux distros. Even in the same distro, it changed in newer versions.
hiiamboris
08:14https://stackoverflow.com/questions/3839756/how-do-applications-resolve-to-different-versions-of-shared-libraries-at-run-tim
qtxie
22:59Not everyone follows this rules in real world. That's why language like go use static link by default.

PeterWAWood
01:01At some time in the future, It might be worth thinking about publishing a statically-linked "beginners'" edition for the Raspberry Pi. It would make it easier for youngsters and the technically inept (people like me) to try out Red.
hiiamboris
06:54@qtxie you mean libcrypt.so.1 is absent on some distributions, but libcrypt.so.1.1 present?
06:54that would be weird
qtxie
08:39@hiiamboris I mean libcrypto doesn't follow this rule. libcrypt and libcrypto are two different libraries.
hiiamboris
08:42right :D
08:42even on WSL
08:44well if such basic rules do not hold, no wonder everything on linux is either monolithic or not working
greggirwin
16:31I consider being self-supporting one of Red's great superpowers. But the tradeoff is implementing things ourselves, to avoid this kind of issue. It all has to be balanced.
Oldes
17:32There is another inconsistency...
>> type? #[none]
== none!
>> type? #[none!]
== datatype!

but than:
>> type? #[unset]
== datatype! ;<--- I was expecting `unset!`
>> type? #[unset!]
== datatype!

17:48Also it looks that it is not possible to _find_ a datatype:
>> find reduce [string! binary!] #[binary!]  
== none
>> find [#[string!] #[binary!]] #[binary!]  
== none
17:49In switch it is ok:
>> switch #[binary!] [#[binary!] ["this works"]]
== "this works"
hiiamboris
18:12find/only
18:13else you're looking for values of that type
18:14
>> ? find
USAGE:
     FIND series value
...
     /only        => Treat series and typeset value arguments as single values.
18:14OK it could have and datatype in it
18:15But length is limited
Oldes
18:15Makes sense.
greggirwin
22:14There's also a ticket on finding typesets. Specs are first on the new roadmap. A big reason is to make behavior choices explicit.
dockimbel
22:59
>> type? #[unset]
== datatype! ;<--- I was expecting `unset!`

Please open a ticket for this one, that's an easy fix.

PeterWAWood
03:19A to tag! test in %convert-test.red is failing on RasPI Buster.
--test-- "to-tag!-integer!"
		--assert <-1> = to tag! -1

The failure:

> <-1> = to tag! -1
*** Script Error: <-1> has no value
*** Where: =
*** Near : <-1> = to tag! -1
*** Stack:
03:40Test "#4781" in lexer-test.red is failing on RasPi4 32-bit Buster. It seems to be related to floating point precision.
The test:
--test-- "#4781"
		--assert 3:3:3.3000000001 = transcode/one "3:3:3,3"

The issue:
>> 3:3:3.3000000001 = transcode/one "3:3:3,3"
== false
>> transcode/one "3:3:3,3"
== 3:03:03.3


Perhaps the test could be changed to :
--assert 3 = first transcode/one "3:3:3,3" 
--assert 3 = second transcode/one "3:3:3,3"
--assertf~= 3.3 third transcode/one "3:3:3,3" 1e-12


Note ~--assertf~= 3.3 third transcode/one "3:3:3,3" 1e-13` failed on the Raspberry Pi.
04:01Test "mp-12" in serialization-test.red is failing on RasPI4 32-bit Buster. I suspect that it is because mold pi is only displaying 15 significant digits "3.14159265358979" whereas the test is expecting 16 significant digits "3.141592653589793"
12:56Does Red treat filenames as Case Sensitive on Linux? I found the following
>> ls 
	README.gtk3       
>> read %readme.gtk3
*** Access Error: cannot open: %readme.gtk3
*** Where: read
*** Near : %readme.gtk3
*** Stack:  

>> read %README.gtk3
== {sudo apt install at-spi2-core #for Error retrieving accessibility bus address: org.freedesktop.DBu...
>> equal? %readme.gtk3 %README.gtk3
== true
hiiamboris
13:00what do you expect? linux file system treats them as case sensitive

Oldes
10:09Is it ok?
>> transcode/one ""
== [] ;<--- why not #[unset] instead?
dsunanda
16:38Is this a bug?....Trying to replicate the last two values in series to its head:
blk: copy [1 2 3 4 5 6]
insert blk skip blk -2 + length? blk
probe head blk
== [3 4 1 2 3 4 5 6]

For reference (and what I was expecting, as this is ported code): Rebol 2 and 3 give:
== [5 6 1 2 3 4 5 6]

While Red seems to need an extraneous COPY to get the same behavior:

blk: copy [1 2 3 4 5 6]
insert blk COPY skip blk -2 + length? blk
probe head blk
== [5 6 1 2 3 4 5 6]
hiiamboris
16:43I'd certainly call this a bug. It first inserts cells then fills them, understandable, but this is not an intuitive result.
dsunanda
17:03Thanks .... Is now issue #5171 ..... The behavior was making a linked list in some ported code go weird :)
greggirwin
19:23@Oldes it's correct the way it is. There is no unset value in there. No values at all.
Oldes
19:38So it is good to have same result for "" and "[]"?
19:39There should be null in this case.. but that does not exists in redbol
hiiamboris
19:45unset seems more reasonable
19:48or an error (requested one value, but none found)
greggirwin
20:021) Why should it be unset? There is no input to say "There's an empty/unset placeholder value here." Unset is something to avoid, not propagate.
2) What is the use case where we care? e.g. we have /next and /scan as well.
hiiamboris
20:05/next has the same behavior
20:071) why should it be a block?
20:082) probably when we forget to check for empty? input
greggirwin
20:08I understand /next does the same thing.

No fair asking the same question back in reverse. I asked first :^)
hiiamboris
20:08a question can partly be an answer in itself
gurzgri
20:09@PeterWAWood equal? %a %A ;== true yes, but also strict-equal? %a %A ;== false in OS independent ways. I don't think equal? returning true even on Linux is a contradiction to the fact that Linux allows them to be different files. And no contradiction in Windows not treating %a and %A as the same file either. As in both cases file names are compared, not files.
hiiamboris
20:09in this case, it points that the question formulation is invalid
20:09TBH, unset gnaws at me too, so proposed error
greggirwin
20:10Why is the question invalid?
hiiamboris
20:10because
> There is no input to say "There's an empty/unset placeholder value here."

doesn't justify the block either
20:11and if anything, unset at least triggers an error slightly faster
greggirwin
20:12load "" sets a precedent, does it not?
20:12As does transcode itself, without the refinement.
hiiamboris
20:12mind transcode vs transcode/one (which @Oldes used)
20:13load "" and transcode "" are not questioned
greggirwin
20:14Again, I am clear on @Oldes question. My point being that what /one means is the crux, as it's not clearly defined yet.
hiiamboris
20:15ok, well, for me one means exactly one value
20:15and while transcode "" always returns a block of zero or more values, one is unsuitable for zero case
think of transcode input as a series of transcode/one input: then /one on empty should be undefined, otherwise it breaks the model
greggirwin
20:15I watched a great talk recently by John Ousterhout, and plan to get his new book. One of his principles, which Red already does quite often, is to avoid raising errors when they aren't important. His example is out of bound indexes on slices. Just return what data you can.
hiiamboris
20:17what's his rationale for that?
greggirwin
20:37https://www.youtube.com/watch?v=bmSAYlu0NcY
20:41> think of transcode input as a series of transcode/one input: then /one on empty should be undefined, otherwise it breaks the model

Good point. But /next solves this, as does /scan, right? Following your logic, /next would throw an error at the end, meaning all transcode/next loops still have to check for empty input or handle the possible error if you go to the end. This is why I asked for use cases. How do we expect /one to be used?
20:41Rather, how did @dockimbel *design* it to be used.
hiiamboris
21:12If you don't check for empty, you end up with an invalid result, or infinite loop (as it will return [] indefinitely)
greggirwin
21:17So you want the error to protect from that?
21:21And how does that relate to other possible infinite loops? Certainly, I agree that preventing problems is a good thing. Just a matter of how best to achieve that.

Oldes
08:08If #[unset] is not good enough and there is no null type, than the only acceptable result (for me) would be:
>> transcode/one ""
** Script error: out of range or past end
08:44The same for transcode/next "" imho.
meijeru
15:03I have a difficulty with remove-each: the following gives an error
>> a: [1 2 3 4 5]
== [1 2 3 4 5]
>> remove-each w a odd? w
*** Script Error: w has no value
*** Where: odd?
*** Near : w
*** Stack:
15:04What do I do wrong?
15:05From the docstring I conclude that w is set to a/1, a/2 etc.
pekr
15:05A subblick?
15:05Block, sorry, on a smartphone.
meijeru
15:05Aha, w is set to a, next a, next next a etc.?
pekr
15:07I mean, should not odd? w be in a block?
meijeru
15:08I apologize, of course it should!
pekr
15:12I was not sure anyway, long time since I last programmed, so did not remember the exact syntax. Shame on me, I get okder and start to forget things 🙂
ldci
15:29remove-each w a [odd? w]
GiuseppeChillemi
16:01Could someone explain what is happening here?

t: func [
	a
	/copy
	/local
	out-data
	o
] [
	out-data: system/words/copy []
	o: make object! compose/only [
		copy: (copy)
	]
]

t2: func [
	a
	/local
	out-data
] [
	probe out-data: copy []
]

probe t [] 
probe t2 []


This is the output:

make object! [
    copy: false
]
none
[]


none should be [] but copy in the second function is none. The third [] should not exists.

If I comment out copy in the object of the first function, I get the correct result.


o: make object! compose/only [
		;copy: (copy)
	]

I have used defined a refinement /copyso both copy and (copy) should not interfere with the global words.
16:03(Note, I have fixed the script)
16:25I have found the cause
16:30It is a side effect of an upper function which encloses both functions. It seems it makes copy: local.
16:32I didn't expect function would collect any set-word! even on prototypes keys in object creation
hiiamboris
16:39I get caught by careless overrides all the time ;)
GiuseppeChillemi
16:49It is one more reason to keep using func instead of function. Having nested functions and objects definition inside them, makes function really a plague! You must shield any block with set-word!s from binding, defining them in a word outside the function binding range and then reduce the word when needed. But then you loose the binding of the refinement word to the inner function and you must bind the block manually. OMG, you can go crazy with this!
hiiamboris
16:52Tip: keep functions small. Get what you can out of them.
GiuseppeChillemi
17:01I usually prefer keeping local needed structures inside the function, to have them organized inside the "container" where they are used.
Maybe, I now see a good use fort function/with in Rebol3, keeping my structures outside the function's block.
hiiamboris
17:14context [structures... f: function [] [...]]
17:15Mind that function re-evaluates whatever you define inside it *on every call!*
GiuseppeChillemi
17:24Yes, I know but I do this when I must have new operative objects on every call, so the the function is recursive. Otherwise I keep inside just the prototypes which are a little word: [proto] setting operation and a small binding overhead.
greggirwin
18:37On transcode/one, @oldes what are you using it for? Anyone else have use cases?

This is the difference we're talking about, right?
; Trim because all spaces is like an empty string to transcode
input: trim "your data here"

; Current design: choose empty default/logic as you wish
val: either empty? input [none][try [transcode/one input]]
if error? val [
	; Invalid data for sure
]

; New error proposal
val: try [transcode/one input]
if error? val [
	; Is the error because it's empty or invalid data?
]

I think this comes back to the design intent that @dockimbel has to weigh in on. Transcode takes an input, and we probably all agree that inputs should be checked. An empty input is a legal edge case. It is not an error. It's also not a value placeholder (unset). But it has to return something. Can't distinguish empty from #[none] if we go that way, which is an issue elsewhere (e.g. select). Today we can't tell "" from "[]" either.

It's a design *choice* with no right or wrong. Any change here is just different, not better.

Side note/bug: Why can't we trim tags?
>> input: trim <your data here>
*** Script Error: trim does not allow tag! for its series argument
*** Where: trim
*** Near : <your data here>
*** Stack:
hiiamboris
18:47> It is not an error

This is where we disagree with you. one (next) value requested - condition that cannot be fulfilled by empty input.
18:49take returns none in this case though, understandably (still an error, but we chose to muffle it)
pekr
19:07I don't like /one name. Maybe /once, not sure either ....
19:08I do agree, that returning empty string/block at edges (tail / head) is perfectly valid
hiiamboris
19:26sorry, where have you seen an empty *string* and what does it have to do with *head*?
Oldes
21:34@greggirwin I was reviewing translate in Rebol3. So my use case was to write test cases with acceptable results. I don't consider current Red result for this case correct, so I mentioned it here.
21:37Btw.. in R3 there is /error refine for relaxed behavior.. returning error instead of throwing it, so no need to use try. I'm on mobile now.. so no advanced example.
21:39https://github.com/Oldes/Rebol3/blob/9ea5fc1a3de5a11759a36df50145ec36a3c21aaa/src/tests/units/lexer-test.r3#L29
greggirwin
23:23I haven't kept up with your version of R3. Looks like /line is new there, and I will have to make time to see what translate is. Thanks.

Oldes
06:17Sorry.. transcode.. not translate.. it was too late for me.
greggirwin
17:02<hehe>

bubnenkoff
08:02Could anybody check next code:
d: [test: none]
x: none 
set d/test 'x

it seems a bug. Console become blank and hang
hiiamboris
08:18You're destroying none value globally.
08:18Forgot the ' before d/test?

luce80
16:39
>> help load
USAGE:
     LOAD source

DESCRIPTION: 
     Returns a value or block of values by reading and evaluating a source. 
     LOAD is a function! value.
...

Does it really evaluate the source ?
dockimbel
16:45No, the docstring is wrong and need to be changed.
hiiamboris
16:55Nope.
greggirwin
17:54It's a bit of a gray area, as a string needs to be tokenized and turned into Red data. We don't have a term for that, except load itself.

luce80
14:20@greggirwin IMHO tokenizing is far away from evaluating but I do not want to start a despute.
14:20
>> help layout
Func spec couldn't be parsed, may be malformed.
...

In which way is the spec unparseable or malformed ?
ne1uno
14:25@luce80, probably from a change with debugging [no-trace]
14:25 are you using an older interpreter?
14:26?? layout
hiiamboris
14:28same result for me, even on today's build
14:31I think it was reported but can't find the report itself :/
dockimbel
15:01Contributions are welcome to fix that help issue.

hiiamboris
18:43@dockimbel
>> replace/all/deep "abc" [skip] ""
*** Script Error: PARSE - matching by datatype not supported for any-string! input
*** Where: parse
*** Near : deep?
*** Stack: replace also
18:44found a regression after all ;)
dockimbel
19:25Thanks, fix pushed.
hiiamboris
19:27I think problem is in any-list though.
19:27Try replace/all/deep "abc" ["b"] "" - works?
dockimbel
19:28That one is not related to the end check removal. It crashes the same on commits before the merge.
hiiamboris
19:50Not reported AFAIK
19:51(but it's not crashing for me)

luce80
15:19
>> about
Red 0.6.4 for Windows built 14-Aug-2022/9:23:14+02:00  commit #4eb8ad8

system/view/silent?: yes
system/view/auto-sync?: no
view compose [
	below
	inp: field 200 "pen green circle 30x30 20" focus on-key-up [out/draw: load inp/text show out]
	out: base
	do [out/draw: load inp/text]
]

Try to **rapidly** remove the "green" word and an access violation will happen.
hiiamboris
16:10reproduced
16:19looks like silent? crashes it?
16:20modified version:
Red []
system/view/silent?: yes
system/view/auto-sync?: no
text: "pen green circle 30x30 20"
view [
    out: base rate 10 on-time [
		remove skip text 4
		out/draw: load text show out
	]
]

just press any key to crash it
greggirwin
18:41If nobody else gets to the help issue before I'm back online I'll look into it.

hiiamboris
12:33@dockimbel on linux when console is just started it prints an error:
*** Access Error: cannot open: %""
*** Where: read
*** Near : 'Red
*** Stack:
12:33could be parse related
12:53perhaps adding not end before https://github.com/red/red/blob/58444429bcaf09ed4500496936a1c3657b533969/environment/functions.red#L758 will fix it?
x8x
13:01this commit break it https://github.com/red/red/commit/1f3694334e94236e5b1c2cce8406978426fceb6e , after it on linux system/options/args returns [""] instead of `none.
that error is actually a printed trapped error from here https://github.com/red/red/blob/58444429bcaf09ed4500496936a1c3657b533969/environment/console/engine.red#L68
hiiamboris
13:20@qtxie was there a change to anti-aliasing mode recently? I'm detecting that text drawn on images became more blurry
qtxie
13:28@hiiamboris Yes. In order to drawing text on fully transparent image.
hiiamboris
13:29okay
13:29cleartype doesn't work with alpha I guess
qtxie
13:34Seems so. Not sure if it's a limitation or a bug in DirectWrite.
luce80
16:06about system/view/silent?, I don't know if this makes things easier or not but when I forgot to use compose:
>> system/view/silent?: yes
== true
>> drawing: [pen green circle 30x30 20]
== [pen green circle 30x30 20]
>> view [
[    	below
[    	inp: field 200 (form drawing) focus on-key-up [out/draw: load inp/text  out]
[    	out: base draw drawing
[    ]
*** Throw Error: no catch for throw: silent
*** Where: either
*** Near : no
*** Stack:
GiuseppeChillemi
17:04has someone experienced the debugger continuously going on creen, like having hit enter after a do/later and then stop in a subcall?
17:05Note: call has been invoked inside a VIEW button actor code.
loziniak
23:13hello. I've got a nasty one:
>> to block! make vector! [2]
== [2]
>> 
>> to block! make vector! []

*** Runtime Error 98: assertion failed
*** in file: /mnt/share/downl/red-master/runtime/allocator.reds
*** at line: 903
***
***   stack: red/alloc-series-buffer 0 16 0
***   stack: red/alloc-series 0 16 0
***   stack: red/alloc-cells 0
***   stack: red/block/make-at 08920554h 0
***   stack: red/vector/to-block 08920564h 08920554h
***   stack: red/block/to 08920554h 08920564h 5
***   stack: red/actions/to 08920554h 08920564h
***   stack: red/actions/to*
***   stack: red/interpreter/eval-arguments 08920544h F65B0A00h F65B0A00h 08920524h 00000000h 00000000h F67B0DF8h
***   stack: red/interpreter/eval-code F67B0DF8h F65B09C0h F65B0A00h 08920524h false 00000000h 00000000h F67B0DF8h
***   stack: red/interpreter/eval-expression F65B09C0h F65B0A00h 08920524h false false false
***   stack: red/interpreter/eval 08920524h true
***   stack: red/natives/catch* true 1
***   stack: ctx||495~try-do F7F8B808h
***   stack: ctx||495~do-command F7F8B808h
***   stack: ctx||495~eval-command F7F8B808h
***   stack: ctx||495~run F7F8B808h
***   stack: ctx||495~launch F7F8B808h
***   stack: ctx||514~launch F7F8B214h
***   stack: ***_start


Can anyone confirm? It's on recent master.
dockimbel
23:36Confirmed, you can open a ticket for it. It's a trivial fix.

loziniak
05:54Here it is: https://github.com/red/red/issues/5178 :-)
luce80
14:06A strange thing happens on Win11.
* open gui-console
* do a script that opens a window
* go to another window (not console nor script)
* close the script window using the thumbnail that appears hovering on the task bar
* when you go back to console it is as if the script did not finished
hiiamboris
14:12it's a known bug for a year or so, but I can't find it :/

luce80
13:12Another annoying thing. **Without** console opened, try this on Win11:
print "" ; open console for debug
view [text "Hello world!" button "Hi" [alert "All right"]]

When I press the "OK" button of the alert the console disappears . It is gone behind other windows I have opened.
dockimbel
13:30Can't reproduce that on Win10, might be specific to Win11.
greggirwin
16:57Looks like help layout broke mid-December of last year.
17:02That's when no-trace was added, which a patch was made for on 11-Jan-2022, but 'layout must not have been used when testing it.
17:05split-path and clean-path as well.
rebolek
17:08help can't parse func attributes
greggirwin
17:12Looks like a spec ordering issue. The parser expects any doc string to come before attrs.
17:16For now we can make help forgiving, but it points out why specs are important.
18:55The reason for that presumed ordering came from R2, which also didn't have a hard spec, but here's an example:
>> ?? throw-on-error
throw-on-error: func [
    {Evaluates a block, which if it results in an error, throws that error.}
    [throw]
    blk [block!]
][
    if error? set/any 'blk try blk [throw blk]
    get/any 'blk
]

qtxie
04:27> Another annoying thing. **Without** console opened, try this on Win11:
>
> print "" ; open console for debug
> view [text "Hello world!" button "Hi" [alert "All right"]]
>

> When I press the "OK" button of the alert the console disappears . It is gone behind other windows I have opened.

It's a known issue which caused by we use a normal window to simulate a modal dialog.
04:29Seems a modal dialog on Windows is kind of special.
hiiamboris
08:18I have the same issue with my email client: newly opened (non modal) email window goes to the bottom of Z-order. I think it's one of the permanent Windows bugs, which we'll have to find a workaround for.
qtxie
09:20@luce80 @hiiamboris Pushed a fix.
ShowWindow

SW_HIDE
0 	Hides the window and activates another window.


*activates another window* :sweat:
hiiamboris
11:25But that makes sense. Otherwise focus will just get lost, which is the most annoying thing to happen.
11:36The fix works fine. But how is SW_HIDE an issue I wonder?
11:39I have a regression though. Need to locate it only :/
11:52Ohh that's a big one.
11:52@dockimbel
>> a: context [x: none]
>> a/x: func [x][]
*** Script Error: a/x: is missing its x argument
*** Where: x
*** Near : []
*** Stack: x

hiiamboris
16:27@dockimbel encountered this?
Compiling to native code...
*** Loading Error: file access error: %../image-utils.reds
*** in file: %/D/devel/red/spaces/programs/datatypes/image.reds
*** at line: 13
16:29Compiling -r any script leads to this error
16:29Must be related to you moving files around recently.
16:31Above path is invalid ofc.
dockimbel
19:05I can reproduce it.
greggirwin
20:07Maybe not worth a ticket, but there's a typo in %function.reds. decode-attributs should be decode-attributes.

@dockimbel it looks like you have it coded so func attrs must come first, before the doc string. Rather than allowing both orders, should I just switch the rules in help from:
opt func-desc=
				opt func-attr=

to:
opt func-attr=
				opt func-desc=

?

dockimbel
15:21Attributes should come first (for now), yes.
greggirwin
16:57Will do. :+1:

dsunanda
13:24@dockimbel Thanks for fixing #5101 - it's been extremely annoying when writing code - typos can be hard to find, and cause weird misbehavior.
dockimbel
13:26@dsunanda You're welcome! I should have fixed it much earlier.
dsunanda
13:28:) I just discovered it was fixed because some old code broke (it had a typo). Very happy that your bug fix found my old bug.
GiuseppeChillemi
22:31Is it a bug or a feature?

>> a: random "lak4tl24k43g3rvuj" probe reduce [random a random a]
["3342atvur4kl4jlgk" "3342atvur4kl4jlgk"]


The randomized strings are equal but if you run the block multiple times, the randomization works.
greggirwin
22:38random works in place, so by the time you probe, a still refers to the original series...both times. :^)
GiuseppeChillemi
22:41but shouldn't the internal randomized seed (pardon If I call it in the wrong way) change at each run, so the randomization on the same string will change at each call?

greggirwin
00:08
>> a: random "lak4tl24k43g3rvuj"
== "llk43kt4u2r3avgj4"
>> reduce [x: random a y: random a]
== ["vk3rl3kuj442atg4l" "vk3rl3kuj442atg4l"]
>> same? x y
== true
GiuseppeChillemi
06:59While building a test on hash! table with this loop:

table: make hash! [[a b c d e]]
random-string: "lak4tl24k43g3rvuj"
repeat idx 100000 [

	random-string: random "lak4tl24k43g3rvuj"
	
	append/only table reduce [
		random-string 
		random-string
		random-string
		head insert copy [] idx
		random-string
	]
]


Red has eaten 3,5GB of ram in 1 minute and then has hanged. Is it expected or should I open a ticket?
hiiamboris
07:49https://github.com/red/red/commit/671dae6581601abf2e54f695a36e44c120887fe0 this should be the answer
07:50tip: don't make hash until you have a finished block
GiuseppeChillemi
09:34So I have not understood how RANDOM works: I thought it would return a different result at each invocation, because on the console:

>> random "lak4tl24k43g3rvuj" 
== "llk43kt4u2r3avgj4"
>> random "lak4tl24k43g3rvuj" 
== "k3akjltv2u44l3g4r"


OMG... maybe I have the answer. It could be because in the console, the same string content is a different series! Lets test it!

>> s: "lak4tl24k43g3rvuj" 
>> random s
== "jlva32l44t3grk4uk"
>> random s
== "4vrgu24jl43katk3l"

09:35Not, even on the same series, I get different result inside the console
09:37@gregg Isn't this test :point_up: [23 agosto 2022 02:08](https://gitter.im/red/bugs?at=63041a7a647d633cf6bda1db)
and my last one on the console the same? (Apart the first random?
Oldes
09:56random just modifies content of the series' data
09:56I don't understand, what you don't understand.
09:57It is event in the doc string twice... _...shuffles series... result (modified when series)..._
10:04Use random/seed when you need consistent results and copy when you want a new series.
>> s: "12345"
== "12345"
>> random/seed 1
>> random copy s
== "52134"
>> random copy s
== "31425"
>> random/seed 1
>> random copy s
== "52134"
>> random copy s
== "31425"

10:07In your test, you should have:
random-string: does [random copy "lak4tl24k43g3rvuj"]
10:14Or something more random, like:
random-string: function[/length len [integer!]][
    len: any [len 8]
    str: make string! len
    loop len [append str to char! (47 + random 73)]
]
10:21(maybe it would be fine to have random working on bitset! too)
GiuseppeChillemi
10:23What is causing me to not understand is here:
>> s: "lak4tl24k43g3rvuj" reduce [random s random s]
== ["kuglj3at432vlk4r4" "kuglj3at432vlk4r4"]
;------ In the console 
>> random s
== "lg4ajurltkvk34243"
>> random s
== "t3r43kg42vlk4ajlu"

If Random modifies (shuffles) the original series, why using it twice in a block does not modify the series and I get the same results in both first and second position?
Oldes
10:24It is same like:
>> s: "123" reduce [next s next s]
== ["23" "23"]
GiuseppeChillemi
10:25No, it's different, there you are modifying series content not the pointer to the series
10:27One moment, I have understood.
10:27No, I havent.
Oldes
10:27
>> s: "123" b: reduce [s s]
== ["123" "123"]
>> random s 
== "231"
>> b
== ["231" "231"]
GiuseppeChillemi
10:28But if you run random s a second time in the console, you get a different result
Oldes
10:28The block b has two pointers to the same series data, which are modified by random. But this is not right group for this chat. It is basic working with series in redbol languages.
10:31Last try to let you understand, what is going on... than you must meditate over it yourself.
>> s: "lak4tl24k43g3rvuj" random/seed 1 reduce [probe random s probe random s]
"ll3v2ru4k34gkat4j"
"4gvkuj4k3r2tlal43"
== ["4gvkuj4k3r2tlal43" "4gvkuj4k3r2tlal43"]
GiuseppeChillemi
10:32> But if you run random s a second time in the console, you get a different result

:point_up:

This is the point
10:37With the last examples you have totally confused me. Where could we move to talk? red/help?
riprwwa
10:43I see this as: the probe expressions are evaluated while the block is being reduced.
This makes us see the 2 different strings, as probe outputs stuff to the console, aka has side effects.
But the end result is the same series s, to which random has been applied twice in-place - the block refers to the same series s
GiuseppeChillemi
10:46@riprwwa I will move this topic to red/help to continue, but now I need 1 hour to relocate.
Oldes
10:50
>> s: "12345" random/seed 1 b: reduce [probe random s probe random s]
"52134"
"15324"
== ["15324" "15324"]

is same like:
>> s: "12345" b: reduce [probe append s "x" probe append s "y"]
"12345x"
"12345xy"
== ["12345xy" "12345xy"]

and:
>> s: "12345" random/seed 1 b: reduce [s s]
== ["12345" "12345"]
>> random s
== "52134"
>> random s
== "15324"
>> b
== ["15324" "15324"]

And that is really my final post on this topic. If you don't understand it, you should go to the first class again and learn, why we have to use copy when working with series.
GiuseppeChillemi
10:59@Oldes don't offend me, otherwise I will say to Hostile Fork that you love his Ren-C and you are asking to accept all his modifications to your Rebol3 😁😁😁
11:15I have finally understood. The console shows the correct behaviour. It returns the same series but modified. Inside the block the second random modifies the series a second time, so that all results, being the same series are modified. In my code there are 4 random numbers but see just the last result in all (the last modification of the series).
11:21It modifies the series and returns the original one. This was to understand. Because another possible hyphotesis was valid too: I have supposed randomwas returning a new instance of the series, randomizing its content in the copy, and at the same time returning the same randomized original value when called again in the block.
11:31@Oldes Thank you, this time I have been caught by a really powerful illusion. Without your example where you have used happend, I would still be entrapped. Redbol languages have multiple possible working scenarios you can imagine, because of the multiple ways things could be done.
11:33(I promise I will not tell Hostile Fork you love his work and you want to merge :-D )
11:47I sudden storm has forced me to remain home, so I have done further investigations on all parts involved.

Also, 2 linguistic problems in the help string have influenced the creation of multiple interpretations:

Maximum value of result (modified when series)

What is modified here: the "result" or the maximum randomized value when series?

And also:

Returns a random value of the same datatype; or shuffles series

Does it shuffles the series and returns the shuffled value, or "shuffles" the original series?


I would modify the function description into:

Returns a random value of the same datatype; shuffles the original series and returns it

greggirwin
19:24@GiuseppeChillemi per your console question:
>> random a: "lak4tl24k43g3rvuj" 
== "llk43kt4u2r3avgj4"
>> random b: "lak4tl24k43g3rvuj" 
== "k3akjltv2u44l3g4r"
>> same? a b
== false

It's very important to remember that the console does not work exactly like in a script in this sense.
19:24It's easy to trip over, especially for those new to Red, but I still do it once in a while too.
GiuseppeChillemi
20:22@greggirwin Gregg the cause of the problem was to find in many different concurrent and possibile scenarios. My brain has been totally blocked, thinking that:
a: "k3akjltv2u44l3g4r" [random a random a] would not modify the original series but it was generating the same random value when it encounters "k3akjltv2u44l3g4r" for the first time. Instead, as all the elements of the block were referring to the same string, the result of the last round of RANDOM was shown into all the elements of the block. This is the same output you have if the function would work not modifying the original string and genereating the same output when it is called over "k3akjltv2u44l3g4r"

luce80
18:35If I have a custom style in whose template I set options they are delete and overwritten by user options, is it by design?:
system/view/VID/styles/ascroller: [
	default-actor: on-change
	template: [
		type: 'scroller
		size: 16x16

		options: [direction: -2]
	]
	init: []
]
view [
	scrl: ascroller options [a: 1 b: 2]
]
?? scrl/options 
; scrl/options: [a: 1 b: 2 style: ascroller vid-align: top at-offset: none]

How can I have default options ?
greggirwin
18:44You do have default options. :^) As you say, they are overridden by the user. Options is just a piece of data like any other. There's is no built-in mechanism for templating or merging from VID. For now, the best you can do is document it for users, unless you want to do quite a lot of deep work on VID itself. In that case, the first thing to do is make a proposal to see if it may be accepted.
18:45A general templating and merging system is on my list, as it's useful in many contexts.

qtxie
04:18> I installed the new GUI and CLI console builds on a Raspberry PI running the latest 32-bit OS (Buster) which is fully updated. The cli console runs fine but there is an issue with missing libcrypto.so.1.0.2

@PeterWAWood Seems the binaries on the download page are wrong for RPi. It should use libcrypto.so.1.1 if it's compiled with target -t RPi.
04:19BTW, you can use it on 64-bit OS. https://github.com/red/red/wiki/%5BNOTE%5D-Linux-GTK-dependencies#armbian

hiiamboris
12:16Uhm.. what do you guys think of this?
>> f: func compose/deep [n [(number!)]] [? n]
== func [n [make typeset! [integer! float! percent!]]][? n]
>> f 10
N is an integer! value: 10
12:17
>> f: func compose/deep [n [(number!) (any-string!)]] [? n] ?? f
f: func [n [make typeset! [integer! float! percent!] make typeset! [string! file! url! tag! email! ref!]]][? n]
>> f "abc"
N is a string! value: "abc"
12:17I suppose it's a helps problem
12:18though I can abuse it:
>> f: func compose/deep [n [(number!) (number!) (number!)]] [? n] ?? f
f: func [n [make typeset! [integer! float! percent!] make typeset! [integer! float! percent!] make typeset! [integer! float! percent!]]][? n]
>> f 10%
N is a percent! value: 10%
dockimbel
15:37That's legal both in Red and Rebol. The arguments types are usually specified with words, but it's only because it's more convenient for us to write even though it's just a proxy for the real thing: datatypes and typesets. The "abusing" example is not a problem as multityping is allowed, it may affect performances though in Rebol. In Red, the arguments cache would squash all type declarations for a given argument into a single typeset.
15:38help should be adjusted to take such cases into account.
hiiamboris
15:38Also, is this a bug or necessity @dockimbel ?
>> o: object [x: 1 on-change*: func [w o n] [print mold/part context? w 200]]
== make object! [
    x: 1
]
>> set o none
make object! [
    datatype!: datatype!
    unset!: unset!
    none!: none!
    logic!: logic!
    block!: block!
    paren!: paren!
    string!: string!
    file!: file!
    url!: url!
    char!: cha
== none
>> o
== make object! [
    x: none
]
>> ;) 'x word was reported bound to `system/words`
dockimbel
15:46Neither. system/words is not a normal context, it serves as a first-class symbol table also. So every symbol gets an entry there (set to unset!) by default. It's an implementation choice (same as in R2, not sure if R3 changed it or not). Anyway, modules inclusion might change that implementation model eventually.
>> to-word "googles"
== googles
>> skip tail words-of system/words -1
== [googles]
hiiamboris
15:47No, I know that. But all other set operations report words bound to the proper object.
15:48
>> o/x: 1
make object! [
    x: 1
]
== 1
>> set in o 'x 2
make object! [
    x: 2
]
== 2
>> o/('x): 3
make object! [
    x: 3
]
== 3
15:48Shouldn't set obj value also take words from object's context?
dockimbel
15:58It should provide a word bound to object's to on-change*, though it seems that can't be always [guaranteed](https://github.com/red/red/blob/master/modules/view/view.red#L422).
GiuseppeChillemi
16:00@dockimbel I don't think Rebol 3 system context works as R2 and Red. Load has the following refinement:
/unbound - Do not bind the block
So, if a block content could be unbound, the word elements are not added to the system context and this means that not all symbols have there an entry.
hiiamboris
16:12@dockimbel it seems like while context's words are red-word!s, they don't carry the binding info? I see _object/set-many just passes them as is to fire-on-set.
16:13I also think it's fixable if fire-on-set sets the context info from it's obj argument.
16:13Question is though, why aren't they bound in the first place?
dockimbel
16:29Because they should have been used as "symbols" only, that are combined with a context node to form words on demand, but we got lazy and just directly reference them or copy-cell those slots instead of properly constructing them when needed. Also object events now could benefit from pre-bound words from context's symbols array.
hiiamboris
16:51OK I'm putting this into an issue then

luce80
12:46For some values of font size the calculated text length is wrong and the text is clipped. I am on Win11
>> about
Red 0.6.4 for Windows built 4-Sep-2022/12:59:01+02:00  commit #d85b2ef
>> view [text "targets react to slider , slider reacts to field" bold font [size: 10]]
12:49[![image.png](https://files.gitter.im/5902e8c1d73408ce4f5b94ba/xqWu/thumb/image.png)](https://files.gitter.im/5902e8c1d73408ce4f5b94ba/xqWu/image.png)
hiiamboris
12:49W10: ![](https://i.gyazo.com/3eb32483e2ad053071e5920f05b5f15b.png)
12:50Make an issue
12:52Ellipsization in GUI console also regressed for me
12:52It's the wrap flag that's the culprit
12:53![](https://i.gyazo.com/e84cca6d43764106b98f70e6c9ab9c28.png)
12:54well, also a failure ;)
luce80
13:01About ellipsization wouldn't it better to have a third option instead of assuming ellpsization instead of clipping ?
hiiamboris
13:10Well, yeah, I agree. Open a REP for the 'ellipsize' flag if you wish :)
13:11UI labels should never ever ever be clipped or ellipsized.
13:11But when it's data, like long file paths, not UI, then it should be controllable.
18:41@dockimbel I'm getting a very hard to isolate stack-related crash in Sep 3-4 builds, but not in Aug 31. Any idea?
20:53Similar to do [do [do [do [... crash I reported but can't find. And involves throw and certain stack depth.
21:03Found it
dockimbel
23:04What was the cause of the crash?

hiiamboris
08:12#4880

luce80
16:56Can I make an issue for this ? :
>> about
Red 0.6.4 for Windows built 4-Sep-2022/12:59:01+02:00  commit #d85b2ef
>> system/view/silent?: yes
== true
>> view [base (error)]
*** Throw Error: no catch for throw: silent
*** Where: either
*** Near : no
*** Stack:
hiiamboris
17:04Yes please :)

gurzgri
19:40Looks like Red doesn't get it right: https://daniel.haxx.se/blog/2022/09/08/http-http-http-http-http-http-http/

>> type? http://http://http://@http://http://?http://#http://  ;== url!
>> url-parser/parse-url http://http://http://@http://http://?http://#http://  ;== none
greggirwin
20:00The lexing rules for url! are simple, and don't match the RFC spec, which decode-url is meant to.
20:02Now it's a matter of seeing where the decoder goes wrong, and if we care. :^) I'll read the article first.
gurzgri
20:04Well that's truly an edge case and I was posting it mostly for the fun of it, should've gone into https://gitter.im/red/chit-chat instead.
greggirwin
20:10He notes the escape rules, but the RFC also has notes about the port number if the colon is used to indicate one should exist. Red's parser *does* require a number there, avoiding the "What is the default port for the scheme?" question. We can note that as an open question.
20:13The decoder could also just set the port to none in that case, leaving it to the user to set if desired.
20:13encode-url is already set to handle none ports.

hiiamboris
11:37@dockimbel is this a map bug or error message bug?
>> m: #()
>> k: 1
>> m/:k
== none
>> unset 'k
>> m/:k
*** Script Error: cannot access :k in path m/:k
*** Where: catch
*** Near : m/:k
*** Stack:
11:44I guess I expected it to say k is unset or smth. Otherwise it looks as if I'm accessing an object, because map lookups are not producing errors usually. Had to double check that it's indeed a map.
dockimbel
12:10It works as expected, see the same case for blocks:
>> b: []
== []
>> k: 1
== 1
>> b/:k
== none
>> unset 'k
>> b/:k
*** Script Error: cannot access :k in path b/:k
*** Where: catch
*** Near : b/:k
*** Stack:
12:11The b/:k path cannot be resolved because k has no value. No lookup occurs in such case.
hiiamboris
12:16I see
dsunanda
17:44I have a large GUI app that works fine on a month-old Red.exe. But running it on yesterday's (red 11-sep-2022) causes the Red console to very quickly ping out of existence.
To narrow down the failure point, I really need something like TRACE that can write its output to a file in real time.
Anyone got something like that? Or some other ideas? Thanks!
hiiamboris
17:47I'm afraid trace only works on small snippets.
17:48Compile a CLI console in debug mode, look at the stack trace for hints.
17:48https://gitlab.com/hiiamboris/red-cli/-/tree/master/mockups/redbuild
dsunanda
17:55@hiiamboris Would a compiled command line run the GUI?
hiiamboris
18:01If you include the View module, yes
dsunanda
18:11Thanks .... No need (maybe). I found the line of code by other means....
....It's setting a PANEL's visible? flag to TRUE, when it already is TRUE. Do that 3 to 5 times and the GUI console vanishes.

Quick fix: The code works fine if I only set it TRUE if it is currently FALSE.
The problem is absolutely repeatable at that line of code.

But I can't (yet!) replicate it in a small snippet for a bug report. That's the next puzzle....
18:51This will crash today's (2022-09-12) Window's GUI console in usually less than 10 clicks of the "Update" button. Comment out the "this!" line for no crash.

win: view/no-wait [
     p: panel 200x200 [box 100x100 blue box 100x100 red]
     return
     button "update" 
       on-up [
          clear p/pane
          append p/pane layout/only compose [box 100x100 (random white) box 100x100 (random white)]
          p/visible?: true    ; <-- this!
       ]     
     ]
greggirwin
18:56Confirmed.
18:57Does not crash on my local build from 08-Sep.
hiiamboris
19:01I'll report it
19:04Thanks for narrowing it down, @dsunanda
dsunanda
19:07 @greggirwin Thanks. Looks like it is a very recent regression. I was fine until I upgraded from 21-Aug.
@hiiamboris Thanks. It was fun (for some definitions of the word fun).
hiiamboris
19:27Actually I'm able to crash any console I have
19:28Just for some it takes a little longer
greggirwin
19:31I clicked about 100 times in my 24-Aug build with no issue.
dsunanda
19:37@hiiamboris Confirmed.
Using your "rate" version (Git hub #5208), older versions will crash, but may live for 100+ interations before crashing.
So it's an old bug that is growing stronger :)
greggirwin
19:38Mutating.
19:40Indeed. Boris' code crashes things nicely.
pekr
19:42My fresh console died in 3 clicks ....

dsunanda
05:06Wow - Fixed already! https://github.com/red/red/issues/5208 (and available in the 2022-09-13 build). Thanks all!
greggirwin
06:23Go @qtxie , go!
Oldes
16:00Is this know?
a: 0.1 + 0.1 + 0.1   b: 0.3
; than:
equal? a b ;== true as expected
; but:
lesser-or-equal? a b ;== false ?!
hiiamboris
16:02yes, it's an FP precision issue
16:02
>> a: 0.1 + 0.1 + 0.1   b: 0.3
== 0.3
>> strict-equal? a b
== false
Oldes
16:16strict-equal? is not related to it. At least if the equality check in lesser-or-equal? is not supposed to be strict-equal as well.
16:17Currently it should be called lesser-or-strict-equal?
hiiamboris
16:24I guess so. But what do you propose? Fuzzy lesser-or-equal? and greater-or-equal?? Then you'll open another trap: both lesser-or-equal? and greater? could return true at for the same value.
16:24Or removing fuzziness from equal? ? :)
greggirwin
17:33Another good topic for the language spec. It's easy to explain, but not necessarily intuitive. We also have to weigh completeness and practical use. That's where the design falls now, though it isn't documented. By this I mean that comparisons for equality are likely used in different ways than their lesser/greater counterparts. Here it makes sense to nearness for the common case, while allowing a strict alternative, as doing it the other way around would be awkward. It does mean there are gaps in consistency however. @meijeru may have thoughts here.

My gut instinct is that the lesser/greater+-or-equal? should be relaxed, as this makes things consistent. It does mean a different gap in logic, and we have to ask if that needs to be filled. We don't have to do it until someone complains, and that can also be worked around for those rare cases. While still awkward, those cases should be much rarer.
17:35I started a [wiki page](https://github.com/red/red/wiki/Language-Spec-Notes) for spec topics.
Oldes
17:37@hiiamboris I propose:
a: 0.1 + 0.1 + 0.1
b: 0.3
true == equal? a b
true == lesser-or-equal? a b
true == greater-or-equal? a b
true == not strict-equal? a b
true == not lesser? a b
true == not greater? a b
hiiamboris
17:47But how can you possibly achieve this?
17:49
>> a: 1.0
== 1.0
>> b: to float! head change back tail to binary! a 1
== 1.0   ;) 1.0 + epsilon!
>> b == a
== false
>> b < a
== false
>> b > a    ;) greater? is already true
== true

Plus lesser-or-equal? will be true as well
meijeru
17:51I suppose "simple" equality allows for deviation in both directions. But could we specify the deviation in the inequality tests (<= etc.) to be unidirectional?
hiiamboris
17:52It will be the same as today (no deviation).
greggirwin
17:53> b: to float! head change back tail to binary! a 1

What is the use case there @hiiamboris ?
hiiamboris
17:53Sorry, where?
17:54I just created a next (nearest) possible float number.
17:55
>> to binary! a
== #{3FF0000000000000}
>> to binary! b
== #{3FF0000000000001}
17:56I should have used add or something :)
greggirwin
17:56I mean, where would you modify binary data and make it back into a float, but it sounds like you don't do that in real life.
hiiamboris
17:56Look above. Oldes does the same, just in a random way.
17:57
>> to binary! 0.3
== #{3FD3333333333333}
>> to binary! 0.1 + 0.1 + 0.1
== #{3FD3333333333334}
greggirwin
17:58He's just doing math. I seriously thought you used that kind of thing in your code somewhere.
hiiamboris
18:00Ah. No ;)
meijeru
18:02Another thought: the problem does not occur with <= and >= because almost equal numbers will satisfy both, provided their near equality is tested first. But in testing < one could also perhaps first test = (with deviation allowed) and if that is true, < will be false; i it is not true, only then < will be tested.
greggirwin
18:02I think unidirectional deviation (as I understand it) would be confusing. I think we need to treat the epsilonic deviation consistently in either direction.
18:04@meijeru the example case shows the <= problem.
>> a = b
== true
>> a <= b
== false

Because = is relaxed but <= isn't.
18:05I agree on how it could work internally using your logic, which I think matches what I proposed.
meijeru
18:06It implies double testing instead of relying on single machine instructions, I suppose, so a penalty in execution time and more complicated code generation.
greggirwin
18:15Indeed. So then we ask, practically, what is most important for floats, which are known to be inaccurate, and what are the main use cases where you might use <=/>= that people need to be aware of. Is it *enough* to warn them? I'd still love, if we can link static bits in the future, to try dropping in Crockford's ASM-sourced DEC64 for decimal! use, to see how it fares in real use. Nothing is perfect, but having different rules for different numeric types is a recipe for human error...on top of FP errors. :^)
hiiamboris
18:20We're talking Red level here. Not machine instructions.
18:22So no noticeable penalty. But! This will lead to alternate versions of all <= < > >= operators (or at least functions). It will be a bigger mess than just = ==
greggirwin
18:24It doesn't lead to alternate version for me. It leads to extra work, as @meijeru noted, if people need to check those strictly.
18:25i.e. it puts that on the user.
hiiamboris
18:25So, instead of a >= b we'll write to logic! any [a == b a > b], nice, especially for library code ;)
18:37<=~ >=~ >~ can be made ops for anyone willing to use these. <~ unfortunately opens a tag.
greggirwin
18:38Yes, which should be rare, but also easily wrapped. At which point you'll complain about performance and I'll say "R2 didn't even have floats, so there was no problem." ...

So, let's start with use cases. Anybody ever have a problem with this in real life?
meijeru
18:39No, we will not need to write the double test in Red, it can be taken care of in the compiler/interpreter, can't it?
hiiamboris
18:40What if you don't want fuzziness? We're back to double the operators set.
meijeru
18:41With floats you will have to accept fuzzyness. If you don't want then indeed you have to double test in Red.
greggirwin
18:41It could, yes, which was my original thought as well, but then Boris said "no machine code", and it *can* be solved at the mezz level. I'm fine with that, but also think we should relax things, which still means R/S work here.

> What if you don't want fuzziness?

Don't use floats. :^)
hiiamboris
18:42My hunch: this will ruin most of the math code ;)
18:43Besides, not Red problem. Proponents should find a language where this is implemented and see how that fared ;)
18:45(I can almost see Nenad coming and saying "let's remove fuzziness from equality to make everyone happy" :)
greggirwin
21:30We can do that for floats once we have a true decimal type.
hiiamboris
21:37I don't share the enthusiasm about decimal type. It's good for formatting numbers, scanning, for multiplying by powers of ten, but most floats will be results of some computations, so why should it matter.
greggirwin
21:46Ummmmm...correctness and human reasoning? The very argument we're having now, because .1 + .1 + .1 <> .3.
21:48If you use strict floats at all times that is.
21:52And why I feel relaxing things is better for the other ops. Which also brings us back to use cases. When and where do you care about strictness with floats, given their behavior in general?
21:58On the URL topic @gurzgri posted. It's easy to change. We don't have full URL parser tests in the codebase, but I have a suite here from when it was built. I based it on the RFC, but got the opt port part wrong.

My tests are based on round-tripping, which doesn't work if ports are optional.
Expected: foo://example.com:/over/there?# 
Got: foo://example.com/over/there?#

Expected: telnet://192.0.2.16:/ 
Got: telnet://192.0.2.16/

Notes I just made:
§3.2.3 says "URI producers and normalizers should omit the port 
component and its ":" delimiter if port is empty or if its 
value would be the same as that of the scheme's default."
 We don't have defaults for schemes, so will only worry about
 the missing port case. That makes round-tripping lossy, as the
 ":" will go away if no port is specified. The alternative is to
 include the colon but still omit the port. Since it still meets
 the RFC spec for the URL grammar, and we aren't technically a
 normalizer, that seems best. But it's problematic as we don't
 have a reference URL, so can't know if it was included to start.
hiiamboris
22:22> When and where do you care about strictness with floats, given their behavior in general?

Everytime I'm choosing between < and <= I care about strictness, even though it's just one unlikely value of difference. Sorry but this is not serious proposal at all. You are for example suggesting that 1e-20 <= 1e-300 and 1e-20 >= 1e-300 at the same time. Or that 1e-20 is not positive? nor negative? number, but zero?. So 1 / 1e-20 should also be not negative not positive, but infinite (of undetermined sign, so maybe a NaN?). And so on.
greggirwin
22:43Did I propose anything like that? No, I didn't.
22:43> Everytime I'm choosing between < and <= I care about strictness,

Not a use case.

hiiamboris
07:35What are the use cases for fuzziness?
07:36I recently used float equality in an assertion. But 1e-10 precision wasn't enough, so I lowered it to 1e-6. So = just doesn't work.
07:37In quick-test you have assertf~= function, with about the same tolerance, not equality.
07:37In base-self-test I'm changing tolerance on case by case basis, usually from 1% to 10%.
11:19Should this be an overflow error, @dockimbel?
>> as-pair 4e9 3e9
== -2147483648x-2147483648
dockimbel
11:36No need, pair! type is in a transition state, until we decide if/how to support floats in pairs (or in a new datatype).
11:38> (I can almost see Nenad coming and saying "let's remove fuzziness from equality to make everyone happy" :)

Could be an option, but the core issue is that we don't have an exact decimal! datatype. I'm very sceptical of DEC64 after seeing the horrifying math issues with DEC32. There's a good reason no language adopted that format for his number type.
hiiamboris
11:44Have a link to these issues?
greggirwin
18:07> What are the use cases for fuzziness?

Exactly what we've been talking about, and my comment about correctness and reasoning. So the use cases are everywhere a base-10 human has to reason about a result, or where FP errors occur. I'm biased against floats largely because of where and how the implementation leaks out and affects humans. I'll tell you my favorite float story sometime. Floats, like some other things in software exist only for, and because of, machines. They are not fit for humans, because we *can't* reason about their behavior and thus use them incorrectly.

https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/ (A couple of the things it links to are fun reads)

Can we keep them for internal use, for performance and compatibility reasons? Sure. I have no problem with that. Am I glad they're called float! and not decimal!. Yes! But let's make people *choose* to use them, and offer something better.

hiiamboris
18:10> Exactly what we've been talking about, and my comment about correctness and reasoning

But typing constants in console is not a use case. I mean do you have code that would benefit?
greggirwin
18:25It absolutely *is* a use case. Consider new programmers. You type something into a Red console and it appears that it can't even do basic math correctly. Now you have to learn about FP and believe us when we say "It's not our fault!" The closest related Red use case I have is %math-lab, where I considered if the args fields should support evaluation. I planned to have extra help, which may all get subsumed in %dict-doc and other tooling. Here we have to explain it.

My historical bias comes from working on financial apps, where amortization calculations and such were subject to FP drift which had to be accounted for. In Red we have money!, but percent! is a float under the hood.

GiuseppeChillemi
23:47
>> help layout
Func spec couldn't be parsed, may be malformed.

Is this know?

hiiamboris
07:58update

luce80
13:53This is same as R2 (!) but should give an error IMHO:
>> -1x-
== -1x0
hiiamboris
14:00agreed, make an issue

dsunanda
18:09This breaks the layout parser:
unview/all view/no-wait [
      rich-text 100x100 data [
          font 9  i "" /i /font
          ]]
*** Script Error: f has no value
*** Where: either
*** Near : f
*** Stack: view layout fetch-options rtd-layout pop cause-error

I think it may be a fairly recent regression.
Workaround: don't have empty strings :)
greggirwin
18:21I went back over a year and it's still there, so not a recent regression.
dsunanda
18:50Thanks....I've just started seeing it; maybe I've not been emitting null strings before.

dockimbel
11:22@dsunanda Please open a ticket for it.
hiiamboris
11:28I think Qingtian fixed it 3 hours ago :)
dsunanda
13:18@hiiamboris Not seeing it fixed in the current windows download. Does that take a few hours to update?
hiiamboris
13:19Ah, different branch https://github.com/red/red/commit/ef3849d332dfb5dd0492762d776a6e302c108944
13:19Maybe incomplete?
dsunanda
13:47Thanks....I'll report it per Nenad's request.....#5231

qtxie
06:50> I think Qingtian fixed it 3 hours ago :)

I'm not sure if the fix is complete. I made a PR so @dockimbel can review it.
dockimbel
11:32Ah, too bad I didn't see your PR in time. I've pushed a fix too, but yours is better. I'll rollback my changes.
dsunanda
19:45@qtxie @dockimbel #5231 looks fixed. Thanks for the fast work!

dockimbel
11:25@dsunanda You're welcome!

hiiamboris
16:27@dockimbel this seems surprising:
>> f: function [w] [a: 1 b: 2  get select #(x a y b) w]
>> f 'x
*** Script Error: a has no value
*** Where: get
*** Near : get select #(x: a y: b) w
*** Stack: f
toomasv
20:32Funny
>> f: function [w] [a: 1 b: 2  get select to map! [x a y b] w]
>> f 'x
== 1
dockimbel
21:21Words in maps are not bound to local contexts, you have to bind them explicitly when needed:
>> f: function [w] [a: 1 b: 2 get bind select #(x a y b) w :f]
== func [w /local a b][a: 1 b: 2 get bind select #(
    x: a
    y: b
) w :f]
>> f 'x
== 1
hiiamboris
21:23What's the reason?
dockimbel
21:24map! is not a data-structure primarily used for representing code to evaluate, so it does not get automatically bound to local contexts like for any-block! series.

greggirwin
18:47Would someone like to add that to the Guru Meditations wiki page?

dsunanda
20:28Is it reasonable to expect this to work?
save/as "" system 'redbin
*** Access Error: cannot decode or encode (no codec): routine ["Internal Use Only"][bool: as red-logic! stack/arguments bool/header: T
greggirwin
20:37No, because strings are UTF-8 and redbin is binary. That issue aside, redbin can't currently encode every value (type). Offhand I don't know what it's tripping over in system.

endo64
09:51About decode-url:

1. It accepts string! but always return none: >> decode-url "http://example.com" ; == none (regression?)
2. decode-url directly calls parse-url which has throw-error refinement, wouldn't be nice to have that refinement on decode-url?
greggirwin
20:051. Doesn't appear to be a regression, just a bug that's always been there. parse-url molds the arg, whether it's a string or not. mold is there because form doesn't hex-encode URLs, but if it's given a string, can we all agree that it's on the user to ensure they are hex-encoded, or do we drop string support?

2. decode-url is meant to be higher level, and exists mainly as a name to balance encode-url, so I don't think we need to expose the refinement there. Do you have a specific use case where that seems better than using parse-url directly?

endo64
07:43> Do you have a specific use case where that seems better than using parse-url directly?

No, actually I could use parse-url directly.

It looks correct to remove string! support from parse-url, but would be ok to keep it in decode-url high level function. And instead of mold, to url! can be used if the argument is a string!.
greggirwin
17:36I agree. Does anybody have a reason to keep string support in parse-url?

meijeru
13:24It seems that an area face that has enabled? set to false does not allow scrolling. I use such a face to display search results and I don't want the user to modify these, but when there are more results than fit in the visible area, I want the user to be able to scroll down. Do we have a bug or a feature here?
14:32Also, does the VID keyword middle work? I can't see it working on text in a field face.
hiiamboris
14:35field is a single line edit box, it's not supposed to support vertical alignment
14:37as for area we should ask @qtxie if it's even possible to scroll a disabled control
14:38even if it is, I don't think it's a good thing to do - one should use a text in a scrollable panel instead
14:40text is dumb though, I can't seem to make it autosize itself properly
14:42https://github.com/red/red/issues/3861
meijeru
15:59@hiiamboris With default sizes for font-height and field height, I find the text aligned to the top, which is not nice.
hiiamboris
16:01my default: ![](https://i.gyazo.com/bbb10e9b42935fd0a07953073b1e656a.png)
16:01what's yours?
16:01view [field "abcd"]
16:02seems very much centered ![](https://i.gyazo.com/33428349a7656cec632a57377cdce742.png)
meijeru
16:09[![Screenshot_20221122_170607.png](https://files.gitter.im/5902e8c1d73408ce4f5b94ba/HUDP/thumb/Screenshot_20221122_170607.png)](https://files.gitter.im/5902e8c1d73408ce4f5b94ba/HUDP/Screenshot_20221122_170607.png)
hiiamboris
16:10yeah not nice, you should report it
meijeru
16:10This is mine. It is definitely not centered.
17:34For the record: issue #5242.

qtxie
03:44> if it's even possible to scroll a disabled control

@hiiamboris There is a ES_READONLY flag. We can give it a try. https://learn.microsoft.com/en-us/windows/win32/controls/em-setreadonly
03:50@meijeru Height 23 should be the standard height. I changed it in the latest commit.
meijeru
12:21The fix works for the standard font but not for e.g. Courier New.
hiiamboris
16:17
txt: " this text^/should be^/ readable"
img: draw 70x70 drw: compose [text 8x10 (txt)]
view [image 70x70 draw drw image 70x70 with [image: img]]

we have some rather crappy image scaling @qtxie
![](https://i.gyazo.com/656b2aed216133ac752e15e63f6195d0.png)
16:20I guess it's even worse for 200% scaling users (I got 150%)

hiiamboris
17:23
>> to-image rtd-layout ["a"]
== none

Shouldn't this work without view and produce an image?
dockimbel
17:30Currently, the rich-text sub-system interface is a face! object of type rich-text, so it can't work without View. We could maybe in the future isolate that API, so that it could be used without View, as we do for images.
hiiamboris
17:36But I mean, it's okay to require the View subsystem, but clearly it should work without actually displaying the face. Currently I just work around by draw size-text r: rtd-layout ["a"] compose [text 0x0 (r)] but seems like extra work.
17:44Although I guess I will have to use this workaround anyway, because to-image will use face's size rather than size-text...
17:45Still, doesn't explain why it should return none.
dockimbel
19:38@qtxie ^---

qtxie
02:38>
> >> to-image rtd-layout ["a"]
> == none
>

> Shouldn't this work without view and produce an image?

rich-text use D2D to draw the content. While the OS API used in to-image only works on native controls. I'll see how to support it.

luce80
17:35@hiiamboris Very nice trick. It's right on time ! ;) but what does it happen here ? :( . This "closes" Red.
draw size-text r: rtd-layout [ red "a" ] compose [text 0x0 (r)]
hiiamboris
17:48report it

ldci
10:29There is problem with change-dir under windows11
Red [
]
home: select list-env "HOME"
home: select list-env "USERPROFILE"
appDir: to-file rejoin [home "/Programmation/Red/BabyCry/code/"]
print ["App Dir: " appDir]
change-dir %..
print pwd 
change-dir appDir

10:29
*** Access Error: cannot open: %"/C/Users/fjouen/Programmation/C:\Users\fjouen/Programmation/Red/BabyCry/code/"
*** Where: do
*** Near : print pwd change-dir appDir
*** Stack: change-dir cause-error

hiiamboris
10:40use to-red-file to convert filenames to an interchangeable representation
ldci
10:44@hiiamboris Thanks:)

hiiamboris
17:17@dockimbel looks like a bug?
>> parse [1] [opt (print "here")]
== false

hiiamboris
15:59Maps have this annoying feature of turning words into set-words upon iteration:
>> m: #(a b)
== #(
    a: b
)
>> keys-of m
== [a]
>> foreach [k v] m [?? k]
k: a:

I find myself constantly tripping on it and having to convert explicitly. Can we fix it?

greggirwin
03:51What do you then do with the set word that causes a problem? I know they're not 100% compatible, but Red is much nicer about allowing set-words with some functions.
hiiamboris
09:03E.g. in switch that is bound to fail.
09:04But why even have set-words when map keys most likely are actually words. You don't access them as m/(quote a:) after all.
greggirwin
18:36*Why* is the proper question. It is by design and documented:

> If the key is of any-word! type, the key type is converted to set-word! in the map, in order to make the map content look more like pairs of keys with value assigned.

So it's consistent with blocks. e.g. if you make a block from a map you'll get the same behavior.

dsunanda
13:48I know index? is only defined on series .... So would it not be better to throw an error when used on a map, rather than the current odd behavior?
index? find make map! #('a 1 'b 2 'c 3) 'a
== 488
`
hiiamboris
14:20it's by design here
14:20index? word returns word's offset in the object where it's bound
14:20
>> index? 'x
== 360

hiiamboris
13:13
view [rich-text "abcdefghij" data [3x4 bold 5x4 underline]]

![](https://i.gyazo.com/381c52f20f5c86c27ce1f3c091359f98.png)
13:14
>> view [rich-text data ["ab" b "cd" u "ef" /b "gh" /u "ij"]]
*** Script Error: RTD - invalid syntax at: [/b "gh" /u "ij"]
*** Where: do
*** Near : spec: fetch-options face opts style spec 
*** Stack: view layout fetch-options rtd-layout cause-error
13:14Should high-level dialect also allow non-stack-like behavior?
dsunanda
13:54In an ideal world, no.
In the world we live in, browers will correctly render badly nested HTML, so if Red needs the ability to convert sloppy HTML to rich-text, then yes. But would thsat be a priority?
hiiamboris
14:02Not a priority, just something to note for the future if we decide so.
14:17Should this be considered bad practice in HTML though to write like this, @dsunanda ?
dsunanda
16:02Browsers embody the 2nd half of Postel's law: "be conservative in what you send, be liberal in what you accept" ..... Which, sadly, enables a billion bad apps to ignore the 1st half.
hiiamboris
16:21I'm asking because I don't see anything bad about this.
Consider this perfectly normal workflow:
![](https://i.gyazo.com/08055c2ffc10fd61a1022636e117a7e6.gif)
How its result should be encoded in HTML? As ab cd ef gh ? It looks like an unnecessary complication to me.
16:23That is, I don't see anything wrong here. And I don't know if HTML spec speaks against it or not.
16:24I'd ask google, but have hard time formulating the query ATM ;)
16:26IMO it's a fundamental mistake of HTML to encode both text attributes and document tree structure using tags. Tree nodes cannot intersect, while attributes can.
Oldes
16:34Nesting is not valid... you may check it here: https://validator.w3.org/#validate_by_input
hiiamboris
16:37Thanks
greggirwin
16:39I don't think we should accept sloppiness and bad input, that's just perpetuating the problem. If we want to follow Postel, that means emitting good HTML (potentially), and we can't do that consistently with sloppy input.
hiiamboris
16:41But as a human what would you write, simple version or nested version?
Oldes
16:42Simple
hiiamboris
16:42That's what I would do too.
greggirwin
17:01Simple, I imagine, but it should catch errors as it does. However, I expect most content will be generated with tools. Devs will still write templates and pieces by hand, but not full documents.
17:02So there the nested version is much nicer for processing. It's not as human friendly in very short content, but once things grow matching tags isn't friendly either.

hiiamboris
15:34@dockimbel what do you think?
15:35And on another topic:
>> parse [1 a] [collect [keep set x integer! (?? x) keep set x opt integer! (?? x)]]
x: 1
x: none
== [1]

Should second keep collect none instead of the empty block?
15:36Though keep is block oriented, so maybe not.
rgchris
20:10@dsunanda @hiiamboris HTML 5 is prescriptive in how any given character sequence is converted into a tree and is consistent across all implementations. This particular case: AB CD EF GH is handled by the Adoption Agency Algorithm which would, as speculated, resolve to AB CD EF GH.
hiiamboris
21:01Good to know, thanks @rgchris
Do you think there's actually some benefit for text attributes to be tree nodes just like the document structure, or is it merely an artifact of syntax derived from SGML?
rgchris
21:19Do you mean text formatting? How would you propose it be handled?
hiiamboris
21:51Bold, italic, underline, strikethru, link target, font size, font face, cursor type - all these attributes can in theory intersect with one another. Designers could have used different syntax for them, that would not require them to become tree nodes, but rather become ranges internally, like our rich-text dialect handles [2x7 bold italic] and so on.
rgchris
23:34Perhaps, though arguably in HTML those aren't formatting elements, rather part of the document structure as well. For example, the tag [is described as](https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-b-element) _"The b element represents a span of text to which attention is being drawn for utilitarian purposes without conveying any extra importance and with no implication of an alternate voice or mood, such as key words in a document abstract, product names in a review, actionable words in interactive text-driven software, or an article lede."_
23:36The mechanism for making that span darker than other text is a separate concern (aka. style sheets)
23:45(and since I used above _"[The i element](https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-i-element) represents a span of text in an alternate voice or mood, or otherwise offset from the normal prose in a manner indicating a different quality of text, such as a taxonomic designation, a technical term, an idiomatic phrase from another language, transliteration, a thought, or a ship name in Western texts."_ 🙂)
23:51I've made the argument prior that View should similarly define UIs semantically and apply style separately. It doesn't always fit (same with HTML—particularly when using it to describe the elements of 'Web Apps') but there's a versatility to it.

hiiamboris
09:27That's how I approached it as well.
09:28Thanks for the info. So they see it as a structure by design.
dsunanda
10:35@rgchris Thanks. Prior to HTML 5, browsers (etc) did their own thing, with a top priority being to make a webpage render, no matter how badly formed the HMTL tags were.
In contrast, XML insisted from day 1 that the only acceptable XML is fully correct XML.
Some say that hindered the adoption of XML. On another hand, maybe it helped attract disciplined developers.

mikeyaunish
02:00Trying to track down what is crashing Red when I run my interpreted program. Is there a trace log I can turn on before the crash?
hiiamboris
10:47compile your console with -d option
10:48using instructions [here](https://github.com/red/red/#running-red-from-the-sources-for-contributors), or [this tool](https://gitlab.com/hiiamboris/red-cli/-/tree/master/mockups/redbuild)
10:50or compile your script with -r -e -d flags and run the exe

mikeyaunish
15:55@hiiamboris I have created a debug console. Haven't used it before so not sure how to use it. I can successfully run my program and crash it.
hiiamboris
15:58just do your script or pass it as an argument to console exe
15:58crash it and see the output if that helps
mikeyaunish
16:09Crash looks like this:
*** Runtime Error 1: access violation
*** in file: /e/red/red/modules/view/backends/windows/gui.reds
*** at line: 146
***
***   stack: gui/get-face-values 00210BBEh
***   stack: gui/paint-background 00210BBEh 50011627h
***   stack: gui/render-base 00210BBEh 50011627h
***   stack: gui/WndProc 00210BBEh 20 1342248487 0
16:10This shows up when using a tab-panel.
hiiamboris
16:14I can see from it only that base is involved
16:15could be some facet having an unexpected value?
16:16look around this list as well: https://github.com/red/red/issues?q=is%3Aissue+is%3Aopen+gui%2Fget-face-values
16:16maybe your problem is reported already
16:20admittedly their search is brutally nonsensical though
mikeyaunish
16:22OK - I'll look into it.
17:47@hiiamboris this bug showed up sometime after: Red 0.6.4 for Windows built 2-Jun-2022/0:50:38-07:00 commit #671dae6

hiiamboris
16:12This doesn't seem correct to me:
>> cs1: charset [31]
>> cs1/31: off 
>> cs1
== make bitset! #{00000000}
>> cs1 = charset []
== false
16:15Same on Oldes' R3 :(
16:30It should either auto-trim itself (slower flipping of trailing bits) or ignore trailing zeroes (slower equality, but still better than cs1 = make bitset! length? cs1). == may still perform fast equality then. <= >= not sure.
16:35As it is it's half-series half-set.
greggirwin
17:07So, should cs-3: make bitset! auto-trim? I don't think so. If so, it does nothing but inefficiently. :^)
17:07The design question is whether the bitset length is part of the comparison. @dockimbel ?
hiiamboris
17:09It could use soft trimming to be more efficient. Track the length of non-zero part. Bitset cell has two unused slots. But flipping will still be slow, e.g. if cs: charset [100000] then cs/100000: off will have to scan all bits to determine the new (zero) length. So this only takes care of the allocations.
17:11Or it could be series, then one could just trim it when needed :)

ne1uno
00:06>> 'm: make map! [0 0 1 1 2 1]' ; Syntax Error: (line 1) invalid integer at 0 0 1 1 2 1]
greggirwin
01:44
>> m: make map! [0 0 1 1 2 1]
== #(
    0 0
    1 1
    2 1
)

What does about tell you @ne1uno ?
ne1uno
01:55latest view 2202 nov
>> about/debug
-----------RED & PLATFORM VERSION----------- 
RED: [ branch: "master" tag: #v0.6.4 ahead: 4573 date: 23-Nov-2022/3:49:21 commit: #ee723a91c5007c4338b8252956063dcd668cf012 ]
PLATFORM: [ name: "Windows 10" OS: 'Windows arch: 'x86-64 version: 10.0.0 build: 19044 ]
--------------------------------------------
>> m: make map! [0 0 1 1 2 1]
*** Syntax Error: (line 1) invalid integer at 0 0 1 1 2 1]
*** Where: set
*** Near : transcode/trace buffer :delimiter-lex
02:00cli too
02:23> ** Script Error: invalid argument: [0 1 1 2 1]
greggirwin
02:29
>> about
Red 0.6.4 for Windows built 29-Dec-2022/13:00:14-07:00  commit #6af0b70
>> m: make map! [0 0 1 1 2 1]
== #(
    0 0
    1 1
    2 1
)
02:30That's a fresh local build for me. Try the latest download and see if it works.
ne1uno
02:46latest view stuck nov22?
greggirwin
02:49@dockimbel ?
ne1uno
03:18same with local build just now
greggirwin
03:18With a recent pull from source? If so, strange.
ne1uno
03:20it works R3 and a 2019 build I keep for testing
greggirwin
03:20Let's see what others report, to narrow it down.
ne1uno
03:25I'm not sure what's going on now, I backspaced before the 2nd zero adding space and it works
greggirwin
03:27Partial character encoding perhaps?
ne1uno
03:30the cli looks like this when I paste, m: make map! [00 1 1 2 1] thought it was weird makes a little sense now. looks the same in view. not my first utf copy & paste bug. sorry
09:27thanks @doc @greggirwin, older chrome knockoff had to remove red-lang cookies