« first day (1763 days earlier)      last day (2017 days later) » 

12:00 AM
@HostileFork compiling with OS_ID=0.13.01; error in src/os/host-main.c: host-init.h not found
 
Btw, is there any way to gray-out a button in Rebol?
 
Sorry, stepped out...
@giuliolunati I'll look into it, 1 sec
 
@fadelm0 May have to make some kind of custom style button with some flag for clickyness
 
@fadelm0 It's getting less clunky. It's a hard balance because it's written in a very old-school way... I'm a C++ person and writing in true systems C code is (by comparison) a very error-prone process, unless you impose process upon it.
 
@kealist How do you flag for clickiness? Is it using feel? Cuz I haven't learned that part yet
 
12:13 AM
@fadelm0 probably. Been a while since I've worked with View
 
@kealist Hmm, I'll see if I learn to do it by the time it becomes a priority. If not, I'll post it as a question. Thanks
 
@giuliolunati You're getting that because of the CUSTOM_STARTUP flag set in systems.r for Android/ARM (the CST here): github.com/metaeducation/ren-c/blob/master/src/tools/…
I suppose the reason is that Saphirion when they had their Android build had some code that was put in the executable. They never open sourced their Android APK generation
For now you can probably take that CST flag off. Check the list of flags there to see what else you want or don't want.
@giuliolunati You might also try building 0.4.21 ... that is Linux ARM and it is labeled "bionic". Maybe that would work for you too.
 
@HostileFork thank you so much!
0.4.21 don't works (includes signals)
Trying 0.13.01 ...
 
12:28 AM
I have 2 more questions. In a text-list, how do you disallow multiple selections?
And how to display text in a field after view/new and clearing all fields?
Should I post these as questions?
 
@fadelm0 If it's "the language doesn't have good enough documentation" vs. an example of code, probably best to ask here first. We sort of want the Rebol language tag to be more about current directions. But @rebolek might know, @GrahamChiu might know, @Brett might know...
 
@fadelm0 I would avoid using text-list. Henrik's list-view is a hell of a lot better
 
f: none
ef: none
co: none

view layout [
	a: button "Click me" [ print "I'm active" ]
	b: button "Disable button" [
		if not none? a/feel [
			f: :a/feel
			co: a/color
			a/color: gray
			a/feel: none
			ef: a/effect
			a/effect: copy []
			show a
		]
	]
	button "Enable Button" [
		a/feel: :f
		a/color: co
		a/effect: ef
		show a
	]
]
That sort of works to gray out a button
 
@HostileFork ren-c successfully compiled natively under Android, thanks to your precious support!
4
Now testing...
 
@giuliolunati nice.
@giuliolunati Good to see you're alive!!!
 
12:35 AM
@giuliolunati :-) Good to hear we have an Android build (so you can do your magic, and this time we can actually process PRs if you send them...!)
 
@kealist Yeah, I've seen it before. Is it easy to control its looks and basic functionality? I just want a simple, mono-selection list. I don't need all the features of list-view.
 
@GrahamChiu thanks!
 
@giuliolunati We thought the serpent had taken you! :)
aka python
 
@GrahamChiu ha-ha! No, Rebol is better.
3
 
I see SL4A is gone
 
12:39 AM
(And priests don't like serpents -- Gn:3)
 
@GrahamChiu Works perfectly, thanks!
Is it the same for btn?
 
btn is just a different style of button I think
But most of us haven't use R2/View for years.
So, I'd think you should post these as questions
 
@GrahamChiu Do you use an alternative?
 
@fadelm0 Yes, I use RebGUI
Ashley is the author of RebGUI, and I've seen him around so that helps :)
 
@GrahamChiu How much of a compromise does it have in terms of ease of use versus control?
 
12:45 AM
I don't recall any limitations
 
@GrahamChiu I'm working around sl4abox = sl4a + kbox3 + connectbot-improved
In sl4abox you can install rebol3-sl4a from debian package
 
@giuliolunati Good to know.
 
And you have vim with mouse emulation, git, gcc, etc
 
@fadelm0 What does this question mean? If you posted a question we could see your code and what you're attempting to achieve
@giuliolunati What apps are you building?
 
Sl4abox and a bible program --- but not with Rebol, for now :-/
 
12:57 AM
In another forum we were discussing the health of the Athonite monks. Any data kept on what these guys die from?
 
@GrahamChiu I mean, when I open a new window in which I clear all fields as soon as it opens, I want to be able to display new text in one of the cleared fields right afterwards, without any user input
There is not much code to show, unless I show the whole thing, which would be too distracting. It's too much embedded
 
You can specify what text is shown at start up
 
@GrahamChiu It doesn't work if I specify it in the field itself, because I assume it gets cleared. Any other way to do it?
 
view layout [ field "hello" ]
view layout [ f: field "hello" button "leave" [ f/text: "goodbye" show f ]]
 
@GrahamChiu Not when I have w: layout [field "hello"] view/new w clear-fields w
@GrahamChiu "These principles gain efficiency at the cost of flexibility. If you need a flexible, generic solution then use VID." This is written below design principles for RebGUI
 
1:08 AM
Need to see all the code to understand what you're trying to do
 
@GrahamChiu Okay, I will try to see how I can package it for a question.
 
you've cleared the fields
do you want to initialise them again after clearing them?
 
@GrahamChiu Yes, exactly. I want to reinitialize one of them. And I can't just not clear it in the first place, because the text depends on the user selection in a previous window.
 
view layout [ f: field "" do [ f/text: "hello"]]
 
@GrahamChiu Hmm, didn't work
 
1:20 AM
@fadelm0 The code as posted doesn't work as it works for me?
 
@GrahamChiu No, as posted, it works. But in the context of my program it didn't
 
there are two ways of initializing a layout. Either you can do it in a do block as above, or you can use view/new, and initialize it after the window appears
view/new layout [ f: field ] f/text: "testing" show f do-events
 
1:40 AM
@GrahamChiu That worked! Thanks a lot
It seems weird though that the do block wouldn't work
 
@HostileFork I've been off work with flu for days and not had the chance to work on imports :-(
 
@johnk Being off work with "the flu" is a perfect time to work on Rebol projects...
 
@johnk Get vaccinated!
 
I did
 
We should codename Rebol3 "the flu". Then people have an excuse.
 
1:46 AM
@johnk Ah.. the flu vaccine only covers the most common variants. Not all.
 
"Can't come into work, got the flu."
 
@HostileFork It's a bit "agricultural" in parts but I'm getting pretty good result from testing of the source tool. It converts and round-trips. Although the round-trip has a couple of issues regarding how to encode rebol strings in comments.
I've also added a little coverity support.
 
@Brett Neat! Would be great if you could git clone Ren/C, then run the tool over it, then commit the delta of what it does so we could browse over the product...
(Since it would just be for browsing to look at and comment on, you can git commit amend and push force to do updates when you tweak, vs. a lot of commits)
I'm really glad you are doing this...I've tried to stress to the people who do Rebol that there's a heckofalot to be done on the Rebol3 codebase even if it's not C programming directly.
I guess we should also decide if we're in love with the stars or not. They are a lot of overhead...
//
// Title: "Some C Source File"
// Description: {
//     Here we can put our description.  Do we need all those stars?
//     They are kind of noisy.
// }
//
 
@HostileFork Hmm. I'm a babe in the woods on this stuff and using source tree. My test currently writes to a new directory which you specify. So maybe you could give it a go locally and see what it's doing.
Initially at least.
Or I can upload to my dev directory.
 
2:01 AM
@ShixinZeng I've noticed you're not completing the comment stars often... presumably you'd be in favor of "less star maintenance"?
 
Been running against an old Ren/C.
 
@Brett Being in the middle of things, it's always easier if I can browse somewhere else, if it's easy...
(also I can not sweat the directory path issues or whatever might get in the way of instant gratification)
 
@HostileFork Btw, How do I refresh my Ren/C fork on Github?
 
GitHub has the advantage of me being able to link to and point to line numbers and go "there!" and make a comment.
 
@HostileFork Sure.
 
2:04 AM
@Brett Git has notions of "fetching" (which doesn't modify the state of files on your checkout, just brings in commits to your local repository from a remote) and then "merging" and "rebasing" to integrate changes. If you don't have local changes, then your merge/rebase is a no-op and could be considered what is called a "checkout"
"pull" is an aggregate operation that means "fetch-and-merge"
If you make sure you don't have any local changes (no yellow or red or green files in your staging area of sourcetree) then if you click on a branch and pull, it should update you.
You can merge too, but if you don't mean to merge anything and have local changes you didn't mean to have... then that might be asking for trouble.
 
So I pull from your remote to my local? And push to my github fork from my local optionally?
 
Ren/C isn't just "me", although I push directly to it as if it were just me more than I might should (for expedience, so I don't have the runaround of sending myself a pull request from hostilefork/ren-c). But there is also a hostilefork remote that you might call "me".
I had an organization already called metaeducation (and I own the domain name, and do little with it). So that's the name of the organization I put Ren/C under. You would be pulling from metaeducation/ren-c's master.
 
Ok thanks. I'l give it a go. Can always delete and start again presumably.
 
@Brett Yup!
 
@HostileFork IfI wanted to just remove my fork of ren-c and re-fork it on GitHub, can I do that?
 
2:15 AM
@Brett Yup, but you don't have to punch through the GitHub web interface to do it. You can overwrite the git data if you use "git push --force". (SourceTree thinks this is a bad enough idea that they don't even include a button for it.)
Note that git's commit IDs are hashed from the content of the commit, and part of that commit is the ID of the parent. So it's a chain of hashes...you wreck history for everything downstream of a commit if you try and rewrite anything, one character in the comment included.
It doesn't matter if no one branches off your work (including you, branching off your own work with later commits)
So my suggestion was you could commit the big batch of rewrites, push it, and then we discuss... then you run it again, and "amend commit" and push --force.
Git is fairly powerful, and even when you run very evil dangerous operations it doesn't GC the old states until a while or you ask it to. You can undo a lot of damage by picking things out of git reflog (reference log)
(Another terrible name, in the spirit of remold and reform...)
 
Ok thanks.
Might start with a few example files to begin.
 
I wonder if we could use just a word ending in colon as a sign that a block of comments is to be interpreted as in Rebol format.
 
Currently my code has made 856 edits on 86 files.
 
//
// Foo: {I'm interpreted as loaded by Rebol because of Foo:, no other markup hint}
//

//
// Blah blah blah I am just a regular C99/C++ comment (C89 lax)
//
 
Couldn't parse 3.
 
2:22 AM
@Brett I'm sure that I'll have it editing many more... :-)
 
@HostileFork I found the parsing tricky. I also have the issue of how to encode newlines in strings embedded in a block into comments without newlines being escaped by Rebol Mold...
But I'll show some examples first...
 
2:48 AM
posted on August 29, 2015 by qtxie

FIX: cannot write file on MacOSX by qtxie

 
3:14 AM
So after all the work on the meta SO/SE split...the result is...nobody reads StackExchange meta.
 
@HostileFork A draft conversion
Kept it separate from source folder for the moment.
 
@Brett Awesome! Let me poke through it...
 
Note the coverity handling in d-crash.c
 
@Brett I'm actually about to change that so we use noreturn attributes instead :-/ But good to be aware of the issue!
 
Well it's an optional comment kept intact. It draws from any notes in the pre-declaration comment on conversion from old style to new style.
 
3:22 AM
Nice to see the function prototypes getting out of the header blocks. I'm not sure what the best way to make the function definitions look natural and stand out is, but Name: "Some_C_Function" is a bit verbose. One step less verbose is to use words, to Name: Some_C_Function. Steps pushing harder on dialects might be to use a tag, so the section starts as <Some_C_Function>. Brevity should be on our radar.
The idea that some "signal" is used to say "hey Rebol, read this comment" where the signal isn't "just the usual" (e.g. //!!! or otherwise) is sort of intriguing as a difference. Starting with a TAG! could be one way of going about that, starting with a SET-WORD! another.
So in that sense, we might see the function leaders as being more like the function spec dialect and less like a module header.
 
@HostileFork eh?
 
@GrahamChiu meta.stackoverflow.com used to have all the stackexchange software feedback that would apply to any site, and it was tied to your SO rep, etc. They went through and divided up the posts and made meta.stackoverflow.com keep all the ones that were about programming and stackoverflow process specifically, while meta.stackexchange.com was about the general software.
 
@HostileFork You're looking for additional meta data than function intros?
 
/*******************************************************************************
**
**  Name: "ajoin"
**  Summary: {Reduces and joins a block of values into a new string.}
**  Details: none
**  Spec: [
**      <1> block
**  ]
**
*******************************************************************************/
Contrast with:
/*******************************************************************************
**
**  ajoin: native!
**  {Reduces and joins a block of values into a new string.}
**  <1> block
**
*******************************************************************************/
Or...
/*******************************************************************************
**
**  <ajoin>
**  {Reduces and joins a block of values into a new string.}
**  (1) block
**
*******************************************************************************/
And if we went lighter on asterisks:
//
// <ajoin>
// {Reduces and joins a block of values into a new string.}
// (1) block
//
Just thinking about how it may be less JSON and more "dialect"
Tags for the native parameters are pretty nice though, but I was wondering if the C function name could stand out without a "Name:"
 
@HostileFork Yep. I Just went with your first idea of a two weeks back. I think you'll need consensus from the gang of C coders. I have not much of an opinion it.
Other than what looks nice.
 
3:33 AM
I think Shixin and I would appreciate something that required less manual maintenance. The burden of having to put comments in a string is irritating but nowhere near as bad as all those stars.
 
I'm generating stars, you mean how it looks?
 
I mean that when we add new functions right now, we have to go find the stars and paste a row of them.
 
Ah..
BTW, the log shows long lines being generated.
 
Awesome
So I think that while explaining what the arguments are for the natives might be excessive, knowing what types they can be is important.
 
But not their string descriptors...?
 
3:37 AM
As I said, we sort of have to balance it and focus on what's important. If you want help you can load Rebol and type "help x". Generally if you're working on the code for the native you know. The things you might lose track of are which index # was which, and maybe overlook what types were legal
 
So
<1> [word! block!]
 
Well, need to know the name of the parameter.
<1> block [word! block!]
That points out a particular importance of drawing attention to the type and the name. :-/
Though I think such cases should just be fixed.
Repeating the description is probably unnecessary as well. We have to consider the audience. If you're programming on the C codebase, you probably know Rebol and it's not that hard to have an interpreter running to ask it questions.
There's only so much bandwidth available and every line of text has a "cost".
So maybe if the block string was reserved for the programmer to use to make notes about the implementation of the native, and preserved by the process (vs. pasted out of the native description) that would be better than having to separate Summary: and Description:
The exception I'd give would be if natives.r stopped existing, and that was the actual spec of the source.
 
@Brett Sorry that I lost tracking of the conversation, what does this tool do to the C source code?
 
@ShixinZeng An idea by @HostileFork to bring rebol metadata to the C code encoded in comments - and to maintain them.
 
@Brett Now that I think about it, I think maybe that is the direction we should be taking, that the native definitions aren't repeated in the source...but come from it
 
3:51 AM
@HostileFork Can explain more and grill you on what you'd like.
 
In which case, it wouldn't be duplication and being more verbose would be fine.
 
That was meant for @ShixinZeng
 
@Brett Cool
 
@Brett maybe that is the idea then. Maybe it should be:
 
It's good to keep related information together
 
3:53 AM
/*******************************************************************************
**
**  ajoin: native [
**      {Reduces and joins a block of values into a new string.}
**      block [block!]
**  ]
**
**  {Blah blah blah not part of the native spec but a comment}
**
**  <1> block
**
*******************************************************************************/
Then we get rid of natives.r
 
That's really a good idea. It's really annoying when you are writing native, and have to look at natives.r and map which arguments and refinements
 
We might have a standard whereby the numbers are on the same line as the types and if the descriptions are all on their own lines. It already gets long sometimes.
foo: native [
    {Description}
    param1 [type1! type2! type3!] ;-- 1
        {Description of param1}
    /refine1 ;-- 2
    param2 [type4! type5!] ;-- 3
]
I dunno, having the numbers broken out is better.
@Brett I think that may point to an answer for the C functions too... that the comment blocks start with set-words. So then if it's a C function, instead of Name: "Append_Value" it is something like Append_Value: .... I don't know what "..." would be for that, but whatever it is, it would be the thing that let you specify things ("things" that weren't function parameters, because those are in the code after the comment block)
Maybe we can split this up with that idea. So that a comment doesn't have to be all Rebol loadable, because that is starting to look annoying.
 
Perhaps think on it some more, hash it out with the C stakeholders. I wonder once you let Rebol in to the C code whether it will spread. So it's good to work out an identifying scheme. I'm going to head off now.
 
@Brett Thanks for the good start! We'll keep thinking on it...
 
Cheers.
 
4:06 AM
@ShixinZeng That will work to get rid of natives.r, but actions.r doesn't have any specific C thing for the definitions. So I guess that file is as good a place as any for them.
 
Oh and encoding a string in a comment has issues with MOLD liking to escape newlines. And the other issue is determining indentation in a string embedded in a comment. I'm off!
 
@Brett I have faith :-)
 
@HostileFork that's right. and actions are implemented in every type, we don't want to repeat that
 
4:40 AM
@ShixinZeng One thing to decide is what we think of the asterisks. If they are maintained by the script they are not as bad. So maybe you can type what ever you want when you are entering them and then it will fix them up for you in a pre-commit script.
So the question isn't so much about "are they a pain" (they are) but do they make the source easier to absorb and browse.
@Brett If we have full information about the natives, something we can do is actually have the opening code of the function do the assignments to the variables. So:
/*******************************************************************************
**
**  ajoin: native [
**      {Reduces and joins a block of values into a new string.}
**      block [block!]
**  ]
**
*******************************************************************************/
{
    REBVAL * const block = D_ARG(1);
There are a few instances where you can't do it quite automatically, like when the name is a keyword (e.g. case is used as what's passed to switch/default). And of course, the current code does not necessarily align the names of the variables in the native body to the names in the native spec.
But... maybe it should. Important to note is that such an assignment is effectively free...by declaring it const there is no "variable" behind it in an optimized build. (There would have to be if you could retarget it, but you can't.)
Er, the above is missing the REBNATIVE(ajoin) line, which still has to be there, but the point stands.
Which brings up a question, I noticed one by-product of the import was that there was a space between the function prototype and the function header block. I don't care for that space...
/*******************************************************************************
**
**  Blah blah
**
*******************************************************************************/

int BlahBlah(...) {
    ...
}
The gap makes it feel like it's labeling a section, vs. labeling that specific function.
I've gotten in the habit of putting a comment "tail" on things when I want to attach them to a specific line vs just be a remark about everything following, like:
; I am a long description
; I am talking about this next line
;
line of stuff

; I am a long description
; I'm just addressing things in general

some stuff
some more stuff

still more stuff
I didn't say it was a great habit, but it's something I have been trying out.
 
5:44 AM
I think the answer is to lose the asterisks, and use a comment format like:
//
//  ajoin: native [
//      {Reduces and joins a block of values into a new string.}
//      block [block!]
//  ]
//
//  Comments about the implementation not related to the spec
//  with no rule about being in braces or otherwise.
//
REBNATIVE(ajoin) {
    REBVAL * const block = D_ARG(1); // auto
    ...
}
The question of whether to use two or one space indent would relate to whether it's considered worthwhile visually to get that "alignment" with the indentation level. It does give the suggestion that it's in a "box". It means you hit slash-slash-tab to get to the content instead of slash-slash-space.
 
posted on August 29, 2015 by dockimbel

[Reddit] Interview with Nenad Rakocevic about Red, a Rebol inspired programming language

 
6:33 AM
There never seems to be anything to where this Reddit posts point to.
 
click on the post title in reddit
 
Maybe this will be the post where everyone pays attention! Or... not. Perhaps Red needs to do something Donald-Trump related.
 
7:16 AM
Could change the interview byline to Sarah Palin?
@iArnold You mean commentary on Reddit?
Mind these posts are relatively new when they post in here. The HN one has more comments than when I first looked:
11 hours ago, by Feeds
posted on August 28, 2015 by pyotrgalois

[Hacker News] Interview with Nenad Rakocevic about Red, a Rebol inspired programming language on medium.com (2 points)

And more points!!!
 
They fixed the pixelly icon when I sent them a better one.
 
@HostileFork How would the end of the rebol be indicated, an empty comment line not enclosed by a block?
Btw a set-word! as first item in a comment seems like a good choice to indicate rebol data.
 
@Brett There's a bit of a requirements problem here where I'm secretly thinking about a kind of Doxygen replacement strategy. I doubt you've read my Low-Commitment Doxygen Markup for C++ article, but this is sort of inspired a bit by that exploration.
 
@HostileFork Your doubt is correct, and I don't know doxygen, should I read up?
 
"It's an extremely bad sign when the C++ parts of your program are syntactically cleaner than your comments!!! :-/"
@Brett I think it's a good article. I'm biased.
 
7:25 AM
:)
 
But if you look over that and connect the dots, I'm sort of trying to apply imagination to figure out if Rebol might be able to step into this space...
Because Doxygen...although really cool...is nuts and huge.
 
7:52 AM
@Brett Anyway, so to your question about "how to tell where the end is"... if it's just the Rebol source we could make arbitrary rules. And maybe the set-word starts it and the first double space ends it. And maybe that's an interesting rule that would work for more than just Rebol?
One thing to note from the Doxygen article is that it's not like the competition has great ideas or something like LOAD and Rebol's syntax to lean on.
But my little bias aside, that shouldn't stop getting simple benefits now. Doesn't have to be a perfect general system.
 
8:11 AM
@HostileFork Happily supporting this will solve one of the indentation roundtrip issues in the tool at present.
 
@Brett The idea of automatically generating the C definitions for the variables corresponding to the refinements is too much for the first step, so let's cut that idea from the first pass. But I think going ahead and putting the full native prototype in and using that to make the natives sounds like a plan. So that means we'll need a routine to be able to get the effect of "load %natives.r" out of a source scan.
 
@HostileFork Added to my todo list.
 
I know some of those natives with descriptions will push over 80 columns
The ones that try to stay in 80 columns now are doing so with the description at 4 spaces of indent. This adds another indent. Which is just life I guess.
 
@HostileFork What's the significance of 80 columns?
 
8:23 AM
@HostileFork Fine. :)
 
In the art as Rebol is, and the medium of text to communicate programs, I think there's a value when the artifact can work within the constraint as laid out by the history. So it's something I'd like to see where possible.
Within limits, this may wind up being one of the exceptions.
 
History, I was thinking it was a constraint I had to work in sometime in the 80s...
but memory is foggy, maybe it was later.
 
Basic.. ahh them's were the days :-/
 
8:50 AM
@Brett The 80 column limit may suggest something that might be a good tendency anyway...
//
//  ajoin: native
//
//  {Reduces and joins a block of values into a new string.}
//  block [block!]
//
It's not necessary to be slavish to putting Rebol-code-as-written into the C source if we have a transformation step.
 
 
5 hours later…
1:50 PM
posted on August 29, 2015 by hostilefork

This very large commit is the "Error Renaissance". It has several aspects, the most visible of which is that there are two keyword-like macros called raise and panic which can be used to give the appearance of something syntactically like a throw construct: if (!IS_OBJECT(val)) raise Error_Invalid_Arg(val); How they work is explained in the comments of sys-core.h. But the gist is t

 
2:05 PM
@ShixinZeng ^-- Okay, that turned out to be... a lot bigger than expected. But the result is a big improvement over what was there. Should solve the dead-end problems, hopefully too...
 
 
2 hours later…
3:45 PM
@HostileFork @earl @sqlab the multiline console branch was merged into the master ?
 
3:59 PM
posted on August 29, 2015 by giuliolunati

OS_ID: 0.13.1 (w/out signals)

 
4:21 PM
@HostileFork I had a brief look at your RAISE and PANIC PR, I would like it to be implemented in a form of function-like macros, instead of pseudo keywords, for a couple of reasons: 1. avoid additional global variables; 2. macros are more traditional C like, and it's less tricky, which means better readablity
I mean, you can change Error_* to take an additional argument, TG_Fail_Prep, and rewrite RAISE as:
oops, Let me rethink how it could be rewritten
OK, I think simply taking Panic_Core/Raise_Core out of Error_Null should be enough. So raise basically becomes Raise_Core
 
 
2 hours later…
6:10 PM
Hi all. So I tried to do my first parse of a .csv file today, and had a bad first experience.
I kept getting all these weird symbols (^@) between characters
Anyone knows what they are and how to get rid of them?
In the original file they are not visible, which leads me to think they are some sort of markers
 
6:32 PM
@fadelm0 can you share csv data and rebol script?
 
@giuliolunati yes, one moment
okay, so the csv is public data from peric.github.io/GetCountries
i'm checking country code, country name, capital, and continent
and basically i'm just storing the read file in a variable
then variable-parsed: parse/all variable none
I'm trying to get the end result of a block, with a separate string for each value in that file
 
Ok, but what rules you use with parse?
 
none
which means it uses the default delimiters, i suppose? I'm still learning to use it
 
@rgchris I clicked the title and there is only comments appearing, true, more than yesterday. Well I kind of expected to get a link to the actual interview. Ah! Then click AGAIN on the title and indeed the interview appears. Fuzzy logic. Thanks for the hints.
 
@fadelm0 Uhm... have you read rebol.com/r3/docs/concepts/parsing.html ?
 
6:49 PM
@giuliolunati Yes, I read about it in several documented places
including that one
And I tried even removing the ^@ characters using parse, but that didn't work either
 
@fadelm0 do you want split your data at spaces?
@RebolBot
parse "ciao beppe" none
 
@giuliolunati That's very interesting.
; Brought to you by: try.rebol.nl
== ["ciao" "beppe"]
 
@giuliolunati No, the data in the file is separated into "data","data data", and I want the block to be like ["data" "data data"]
When I parse it though, it's keeping the quotes for some reason, and I'm getting [{"data"} {"data data"}]
In addition to those weird characters I was talking about
 
@fadelm0 "none" rule splits at spaces, then return block.
For csv data you must use ad-hoc rules
 
@giuliolunati But if I add /all to parse, doesn't it ignore spaces?
@RebolBot parse/all {"This is joined","This","is","separated"} none
 
7:05 PM
@fadelm0 Can you elaborate on that?
@fadelm0 What do you mean?
 
how do you send code to this thing?
 
@RebolBot
print "hello fadelm0"
 
; Brought to you by: try.rebol.nl
hello fadelm0
 
@RebolBot
parse/all {"This is joined","This","is","separated"} none
 
,,
 
7:08 PM
; Brought to you by: try.rebol.nl
== ["This is joined" "This" "is" "separated"]
 
@RebolBot
parse/all {"This is joined","This",is,separated} none
 
; Brought to you by: try.rebol.nl
== ["This is joined" "This" "is" "separated"]
 
According to the author of codeconscious.com codeconscious.com/rebol/parse-tutorial.html the default delimit characters are {",;}
 
@fadelm0 you're right
 
I think the problem is just that the file is so full of these ^@ that parse isn't able to process it correctly
 
7:21 PM
@RebolBot
print to-char 0
 
; Brought to you by: try.rebol.nl
 
@RebolBot
probe to-char 0
 
; Brought to you by: try.rebol.nl
#"^@"
== #"^@"
 
@fadelm0 ^@ is 0-char
 
@giuliolunati Hmm, what does that mean?
 
7:24 PM
0-ascii = string terminator in C
 
Great! C.
How does one get rid of those?
 
@fadelm0 sorry I must run... but I'll go back
 
@giuliolunati ok!
 
8:01 PM
@RebolBot
r: ""
t: none
parse {^@be^@bop^@a lula} [ any [
copy t [to #"^@" | to end] (append r t)
opt skip
] ]
probe r
 
; Brought to you by: try.rebol.nl
"bebopa lula"
== "bebopa lula"
 
@fadelm0 see above
 
@giuliolunati Amazing. How long does it take to become that proficient?
Let me try it
Hmm, gives Script Error: Not enough memory
** Where: append
** Near: insert tail series :value
on the file
 
@fadelm0 can we see the code?
 
8:17 PM
@ShixinZeng I'm afraid I want the trick. There's nothing wrong with the variables (Rebol has state/global variables everywhere, the data stack etc., one more does not hurt at all). The value in having it as a keyword-looking thing is that when you read it becomes abundantly clear that something is going on and it is that very important "readability cue" to know "this does not return".
 
countries2: ""
t: none

parse countries [ any [
copy t [to #"^@" | to end] (append countries2 t)
opt skip
] ]
countries contains the data from the file
 
@fadelm0 how much long is countries?
 
@ShixinZeng I consider the readability cue to be crucial. Without it, then you are reading along and you don't have that "this dead-ends and does not return" cue. It looks like a function, and the very important "does not act like a function" property is not captured about it.
 
@giuliolunati 249 lines, 9406 characters
 
@fadelm0 uhm... not so long...
Try cut him at some point
 
8:28 PM
@ShixinZeng I might agree with you that "globals are bad" and it should be a controlling concern in a codebase that didn't have any. This isn't that codebase. Everything from PUSH_TRAP to DS_DROP uses global/thread-local state. Moreover, as an implementation detail thread-local variables are C and C++ standard now as of C11 and C++11, so if one is imagining the "far" future then it's a compiler-supported thing.
 
@iArnold It might be an idea to link through to the article in such cases, but the first goal of our feeds is advocacy—it's no bad thing to add a wee sly upvote on our way through of the sites we link to 'cause votes create interest...
And being able to respond to any questions that might arise there too.
 
@Feeds Thanks for the PR! I'll let @earl look at it and decide what the builds plan is for that...
@noein @earl seemed to have it ready, but didn't quite push the button yet.
 
@giuliolunati It gives the same error even with one line. Just faster
 
@fadelm0 can we see that line?
 
8:43 PM
@giuliolunati (the @feeds above was meant for you...)
 
@giuliolunati I uploaded the csv file here tempsend.com/76ECA89151 since I thought posting it here would strip the ^@ characters
 
@HostileFork oh... good! :-)
 
@fadelm0 Note when you are typing a multi-line message there is a "fixed font" orange button to the right of the text entry. This will put 4 spaces at the start of each line (which will not be visible in the post) and then when you submit it, it will preserve your indentation. Also note (if you haven't yet) that you can edit your postings for 2 minutes. You can use the up arrow to reload the last message you've posted into the text area, or hover and chose from the drop-down menu.
 
@fadelm0 ok, just a moment...
 
@HostileFork Noted. Thanks. Is the editing only possible for the last message?
 
8:50 PM
@fadelm0 Not if you use the drop down menu (the pointing down arrow you get when you hover over a message), but the 2 minute constraint still applies.
 
@HostileFork Ah, I see
 
9:03 PM
@HostileFork encountered an error "missing or unsupported encoding marker" in conversion binary -> string
Any new in encoding management?
 
@giuliolunati All changes have pertained to fixing invalid memory accesses and other such problems; nothing intentionally different has happened to functionality. If you have a reproducible bug and can narrow down to a small case that does it, I can have a look...
 
@RebolBot
to-string #{fffe22}
 
; Brought to you by: try.rebol.nl
; rebol.com/r3/docs/errors/script-bad-decode.html
    *** ERROR
** Script error: missing or unsupported encoding marker
** Where: to to-string
** Near: to string! :value
 
@HostileFork that^
 
@giuliolunati Are you sure this is a valid UTF-8 string?
 
9:16 PM
@fadelm0. Your file is in utf-16 so every char has an extra-zero
@HostileFork not, is utf16...
 
@giuliolunati yup, to-string only decodes binaries that are UTF-8...
That message would be more helpful if it mentioned UTF-8!
"missing or unsupported UTF-8 end marker" or somesuch
 
@HostileFork I agree
@fadelm0 can we see how you converted file to string?
@HostileFork I'm glad to see that bug with long cmdline has been fixed :-)
 
@giuliolunati Several command line bugs got fixed...!
 
@giuliolunati I just did countries: read %countries1.csv
But I just solved my problem!
When pasting the data to notepad and saving to file, I just kept it in ANSI and didn't convert to UNICODE as it prompted me to
So all the char-0s were gone
 
@fadelm0 Very well!
However, when you read file the return value is binary, not string.
 
9:32 PM
@giuliolunati Oh, really? How do you read as string then? to-string read?
I think I tried that before with the previous file
 
>> help to
 
Exactly, but must be utf-8 encoded
 
; Brought to you by: try.rebol.nl
USAGE:
    TO type spec

DESCRIPTION:
    Converts to a specified datatype.
    TO is an action value.

ARGUMENTS:
    type -- The datatype or example value (any-type!)
    spec -- The attributes of the new value (any-type!)
 
But the file was utf-16?
 
@fadelm0 Note that TO-STRING is really just a convenience that means TO STRING!. Some people don't like having to hit the shift key to get the exclamation mark, I guess. :-)
So I would as with the "new user glasses" what you think of to string! read blah blah vs. to-string read blah blah. Any first impressions?
 
9:35 PM
@fadelm0 yes, that was the problem
 
@HostileFork Yeah, when people use the type! syntax in sentences, it sounds to me like they are very excited about it.
 
I actually like the former, because I used to-string and to-binary and such for a while not realizing there was a TO function. So I would end up with switch statements or conditionals I didn't need... result: either type = binary! [to-binary value] [to-string value]. So TO has more discoverability that you could just write result: to type value
 
@giuliolunati Well, thanks for bearing with me. Glad I got that solved, now I can get some real work done :)
 
The exclamation point bothers some people in the readability. It's hard to imagine what other character could be used. We don't want the type to just be the plain name, so it needs a decoration of some kind.
 
@fadelm0 happy to ear that! Have a nice day/night!
 
9:38 PM
@HostileFork, I apologize for the dumbness of this question, but I am stuck. Are there any utility functions in the codebase for removing an element of a REBSER at a specific index?
I know I can roll my own, but that ... sucks.
 
@HostileFork It doesn't bother that much in code, I mean just when people talk about it.
 
There's all kinds of appenders, but no removers.
 
@HostileFork You mean if you separate the to from the type, you would be able to sometimes make code shorter?
 
	case A_REMOVE:
		// /PART length
		TRAP_PROTECT(VAL_SERIES(value));
		len = D_REF(2) ? Partial(value, 0, D_ARG(3), 0) : 1;
		index = (REBINT)VAL_INDEX(value);
		if (index < tail && len != 0)
			Remove_Series(VAL_SERIES(value), VAL_INDEX(value), len);
		break;
@MarkI ^-- code for the A_REMOVE action in f-series.c
 
Thanks, that should do it.
 
9:42 PM
@fadelm0 I mean that having TO with two parameters, a type and the value to convert, is more flexible than having N functions which take only one parameter...because the type to convert to can be an expression. Since that generic TO is what is underneath all the TO-XXX variants, it's nice to know about.
I was lamenting that I didn't know a two-parameter TO even existed for a while, because all the code I'd seen used the hyphenated versions!
So I would write awkward code when I needed the type to vary that would wind up picking which hyphenated version to call, instead of just using the TO with an additional parameter and being done with it.
 
@HostileFork Ah, I see! So the hyphens made it a little hard to recognize that
 
This makes me wonder if early code samples should use TO STRING! instead of TO-STRING
My push for a while was to get rid of the TO-XXX functions altogether, but that is unpopular, since a lot of people like them.
 
It does seem logical. Makes it easier to understand exactly what is happening when you call the functions.
All the time I thought these to-XX functions were something different. So for me it seemed like there were more things to learn than there actually is in reality
So, I'd vote for getting rid of them
But I'm not a hardened coder yet, so my opinions are easily acquired, since I'm not really too used to anything yet :P
 
Getting rid of them is not an option it would seem, but keeping them out of early tutorials is... so, thanks for the vote.
 
That would be a good idea
 
 
1 hour later…
11:17 PM
I am so depressed now. I've got angle-words and escaping in tags working perfectly. Well, tags don't MOLD right yet, but their content is right. The reason I am depressed is because the coding is over (it was too fast, really, I got nothing done until I dedicated a whole day, and then it took me only until now -- but it was the most fun I've had in years), and only the painful publishing remains ...
 
@MarkI Worse reasons to be depressed. Publish away!
And if that's the most fun you've had in years, you might need a vacation of some kind.
(But you're not allowed to take one until you've finished the lexer backlog. I said you might need it, not that you'd get it.)
 
@HostileFork After I eat.
@HostileFork Most coding fun, I should have said. But you are still right.
@HostileFork It also fixes 15 non-tag-related bugs, because they were too stupid not to fix.
2
 

« first day (1763 days earlier)      last day (2017 days later) »