• Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

AltME groups: search

Help · search scripts · search articles · search mailing list

results summary

worldhits
r4wp55
r3wp797
total:852

results window for this page: [start: 801 end: 852]

world-name: r3wp

Group: Parse ... Discussion of PARSE dialect [web-public]
MaxV:
15-Mar-2011
Did you see http://www.rebol.org/view-script.r?script=supercalculator.r&sid=f4jz
(script start in the just last 20 lines)
instead of parse you can use "replace/all" and work evene better
Steeve:
29-Apr-2011
even if, just replace 
>skip
by 
> skip opt to "["
(not tested)
Pekr:
31-Oct-2011
not fluent with html escaping, what's the aim? To replace stand-alone 
#"&" with "&amp"?
BrianH:
2-Dec-2011
Here's the R2 version of TO-CSV and TO-ISO-DATE (Excel compatible):

to-iso-date: funct/with [
	"Convert a date to ISO format (Excel-compatible subset)"
	date [date!] /utc "Convert zoned time to UTC time"
] [

 if utc [date: date + date/zone date/zone: none] ; Excel doesn't support 
 the Z suffix
	either date/time [ajoin [

  p0 date/year 4 "-" p0 date/month 2 "-" p0 date/day 2 " "  ; or T

  p0 date/hour 2 ":" p0 date/minute 2 ":" p0 date/second 2  ; or offsets
	]] [ajoin [
		p0 date/year 4 "-" p0 date/month 2 "-" p0 date/day 2
	]]
] [
	p0: func [what len] [ ; Function to left-pad a value with 0
		head insert/dup what: form :what "0" len - length? what
	]
]

to-csv: funct/with [
	"Convert a block of values to a CSV-formatted line in a string."
	[catch]
	data [block!] "Block of values"
] [
	output: make block! 2 * length? data
	unless empty? data [append output format-field first+ data]

 foreach x data [append append output "," format-field get/any 'x]
	to-string output
] [
	format-field: func [x [any-type!]] [case [
		none? get/any 'x [""]

  any-string? get/any 'x [ajoin [{"} replace/all copy x {"} {""} {"}]]
		get/any 'x = #"^"" [{""""}]
		char? get/any 'x [ajoin [{"} x {"}]]
		scalar? get/any 'x [form x]
		date? get/any 'x [to-iso-date x]

  any [any-word? get/any 'x any-path? get/any 'x binary? get/any 'x] 
  [
			ajoin [{"} replace/all to-string :x {"} {""} {"}]
		]
		'else [throw-error 'script 'invalid-arg get/any 'x]
	]]
]


There is likely a faster way to do these. I have R3 variants of these 
too.
BrianH:
2-Dec-2011
Here's a version that works in R3, tested against your example code:
>> a: deline read clipboard://
== {a,      b ,"c","d1
d2",a ""quote"",",",}

>> use [x] [collect [parse/all a [some [[{"} copy x [to {"} any [{""} 
to {"}]] {"} (keep replace/all x {""} {"}) | copy x [to "," | to 
end] (keep x)] ["," | end]]]]]
== ["a" "      b " "c" "d1^/d2" {a ""quote""} "," ""]


But it didn't work in R2, leading to an endless loop. So here's the 
version refactored for R2 that also works in R3

>> use [value x] [collect [value: [{"} copy x [to {"} any [{""} to 
{"}]] {"} (keep replace/all any [x ""] {""} {"}) | copy x [to "," 
| to end] (keep any [x ""])] parse/all a [value any ["," value]]]]
== ["a" "      b " "c" "d1^/d2" {a ""quote""} "," ""]


Note that if you get the b like "b" then it isn't CSV compatible, 
nor is it if you escape the {""} in values that aren't themselves 
escaped by quotes. However, you aren't supposed to allow newlines 
in values that aren't surrounded by quotes, so you can't do READ/lines 
and parse line by line, you have to parse the whole file.
Endo:
2-Dec-2011
BrianH: I tested parsing csv (R2 version) there is just a little 
problem with space between coma and quote:


parse-csv: func [a][ use [value x] [collect [value: [{"} copy x [to 
{"} any [{""} to {"}]] {"} (keep replace/all any [x ""] {""} {"}) 
| copy x [to "," | to end] (keep any [x ""])] parse/all a [value 
any ["," value]]]]]

parse-csv {"a,b", "c,d"}  ;there is space after coma
== ["a,b" { "c} {d"}]   ;wrong result.


I know it is a problem on CSV input, but I think you can easily fix 
it and then parse-csv function will be perfect.
Group: !REBOL2 Releases ... Discuss 2.x releases [web-public]
Graham:
15-Apr-2010
If this works out, it might be cool to write it as a port scheme 
so that we can just replace the 'open
Group: !REBOL3 Extensions ... REBOL 3 Extensions discussions [web-public]
Andreas:
5-Nov-2010
i think you could also replace RXI_GET_CHAR by first obtaining a 
pointer using RL_SERIES(ser, RXI_SER_DATA) and then just indexing 
into this directly
Maxim:
10-Nov-2010
and replace:
#define RL_PRINT(a,b)               RL->print(a,b)

with:
#define RL_PRINT(a,b)               RL->print(a,__VA_ARGS__)

can't test it right now, but that should work.
Andreas:
13-Feb-2011
Search thru all your source files for RXARG_SERIES and replace it 
with RXA_SERIES
BrianH:
3-Oct-2011
It just occured to me that the import statement above could have 
potentially unwanted side effects on the user context. Replace this:
	odbc: import 'odbc
with this:
	odbc: import/no-user/no-lib 'odbc
Group: !REBOL3 GUI ... [web-public]
Pekr:
25-Dec-2010
I just mean if your docs will replace rebol.com wiki ones?
Oldes:
2-Jan-2011
btw... many host-kit fixes are pretty easy if you know where to look... 
for example to enable image gobs in Carl's host-kit, one must just 
remove the temp_remove and replace:
	int gobw = GOB_CONTENT(gob)->size & 65535;
	int gobh = GOB_CONTENT(gob)->size >> 16;
to:
	int gobw = GOB_W(gob);
	int gobh = GOB_H(gob);

https://github.com/rebolsource/r3-hostkit/blob/4d3bdeaa77cf1ec7c5d97738509ecec4fdf4b7e7/src/agg/agg_compo.cpp#L594


And that's all... I really wonder why you keep the host-kit updates 
hidden. Even Carl was able to put it on github:/
Pekr:
14-Jan-2011
I have one qeustion towards "faced" attribute. In fact I liked it 
- it clearly distinguished attributes, which are meant being local 
to each instance of the style. Could anyone elaborate on why it was 
deprecated, and how is such functionality replace in new release?
Ladislav:
16-Jan-2011
aha, insert is probably not good, since it does not replace the previous 
content - well, the problem is, that change does not work for gobs 
yet, so you need to remove and insert, until change is corrected 
for gobs
Pekr:
18-Jan-2011
Could you try following code? You can eventually replace 'vpanel 
by 'hpanel [break-after: 1]. With vpanel, it just causes stack overflow, 
with hpanel, it kind of displays panel, but try to resize the window 
and see the mes ...


REBOL []

do %r3-gui.r3

lay: [

		when [load] do [print "Load trigger!"]
		clicker
		button "Do" alert "Button pressed!"

  button "Big Quit Button" maroon options [max-size: 2000x50] quit
		bar
		text "Toggle button..."
		t1: toggle "Toggle" of 'tog
		button "Set False" set 't1 false
		button "Set True"  set 't1 true
		toggle "Mirror" attach 't1
		toggle "Mutex" of 'tog
		bar
		text "Radios and check boxes"
		radio "Set above toggle on"  set 't1 true
		radio "Set above toggle off" set 't1 false
		bar
		check "Checkbox attached to above toggle" attach 't1


]

child: make-face 'vpanel []
set-panel-content child lay
view child
Ladislav:
19-Jan-2011
as a temporary measure, you could replace the

show-native: :show

by

unless any-function? :show-native [show-native: :show]
Henrik:
18-Feb-2011
IMHO, if OPTIONS in layout were to go, I would replace it with WITH.
Pekr:
26-Feb-2011
Because I am thinking into looking into Carl's scroller, trying to 
replace RMA's draw block. I wonder, if it could break because of 
material system, or would it work?
Pekr:
26-Feb-2011
But - technically wise I just might remove draw block (replace it 
with zero or minimal code), and style would still work? So free to 
play whatever the way I like with the style visual representation?
Pekr:
11-May-2011
What you are basically doing is some OOP aproach here. But adding 
the code to the end? Who decided that? There are three levels - replace 
action, pre-init, post-init. So what do we choose? In Visual Objects 
I had all three capabilities. Dunno if you would find that usefull 
though ....
BrianH:
31-Jan-2012
We can't hot-patch functions in R3 for security reasons, but we can 
replace them completely with fixed versions.
Group: !REBOL3 Host Kit ... [web-public]
Pekr:
20-Oct-2010
Cyphre - I am not sure if we should accept CSS document model here, 
as users/designers are used to it? I tried to search for some typography 
vocabulary, but there is not much in it:

http://www.proximasoftware.com/fontexpert/terms/


Then I also looked into MS Word (well, not the best DTP option, I 
know :-), but I am somehow satisfied, how paragraph styling is done 
in it, and I find it pretty much flexible. So few of my notes:

PAGE:
--------
- text-gob - let's say it equals to page


- margin should allow to set 4 sides, as is with CSS and even DTP 
systems. DTP system talk about margin as about the space to the edge 
of the paper. I don't know, how such terms are used in conjunction 
to R3 GUI, but we should somehow find-out, how to not be confusing. 
But - having just a single marign is not imo sufficient.


- origin should replace scroll, and it should mean offset. But looking 
into VID2, origin just did what you propose - but I don't like it, 
as it required us to introduce offset to VID2.

PARA:


- indent - e.g. MS Word defines: indent-left, indent-right (kind 
of creates margins/padding, if you relate to CSS terms), then they 
have indent-special - first-line | "pre-indent" (-first-line,not 
much usefull). It also has check-box for "mirror setting", which 
changes indent-left to inner, and indent-right to outer (dunno what 
it is good for)


- spacing - top-space | bottom-space - but here, it is not inner 
space in paragraph, it is more of an indentation between paragraphs. 
In other words - I can imagine calling it even padding (as we are 
used from VID2, we used space there for the auto-spacing). It allows 
you to set, that it will not add space in between two paragraphs 
of the same style. It also allows you to set spacing for rows - either 
by float, or by multiples, 1,5 rows, double, the-least-possible (pixels), 
exactly (pixels)


- paging - some stuff to set in regards to paragraph and paging, 
as linking of paragraphs, linking of lines

- runaround settings (dunno if correct english term)
Cyphre:
21-Oct-2010
Pekr, thanks for your useful feedback, some reactions:

PAGE

margin should allow to set 4 sides

 - this is done by using ORIGIN and MARGIN pair!s in the proposal, 
 I agree, we can use MARGIN with two pairs instead of that

origin should replace scroll
 - ok, makes sense if we accept the point above

PARA


indent - INDENT should define rectangular space at the beginning 
of the paragraph, the left right orientation would be chosen according 
to the horizontal align settings in each  paragraph. The value for 
indent could be pair! (to define the space in both ways) or number! 
to define just the horizontal indentation for the first paragraph 
line only.


spacing - here I'd use SPACING [pair!] for additional space between 
chars (X axis) and lines (Y axis). For space around paragraph (top, 
left, bottom, right) I would use PADDING.


paging - IMO linking of text between gobs at the C level would bring 
us lot of complexity. I still think we should provide functionality 
that can be useful at REBOL script level to handle the linkage.


runaround - this needs to be well thought so it is flexible enough 
once we allow to use embedded gobs in the text flow


alignment - I'd leave it as in the current proposal for now. Which 
means horizontal align can be set per paragraph vertical alignment 
per 'page'(=GOB)


I'll be updating the current document soon to reflect all the changes 
from yours and other useful suggestions. I'll post here once new 
version is online.
Maxim:
25-Oct-2010
I can't seem to be able to use the function 'REPLACE from within 
the init code of an extension under A109.   

in A107, using the same source code I have no problems

but now (in A109) I get this error:
** Script error: replace word is not bound to a context
Maxim:
25-Oct-2010
yep... just removing the replace function all is good.   so I guess 
the replace function is missing from whatever context is setup when 
an extension's module is loaded.
BrianH:
25-Oct-2010
That should not happen. it would make sense for some words to be 
undefined but not REPLACE.
BrianH:
25-Oct-2010
In a fresh console:
>> in lib to-word "replace"
== replace
>> sys/load-module "rebol [] print type? :replace"
function!
== [none make module! [
    ]]

So that is not the problem - REPLACE is defined in lib at startup.
BrianH:
25-Oct-2010
Host code goes through a process at load time and loading most of 
the mezzanines happens later in the process. If you load your extension 
before the mezzanines finish loading, no REPLACE.
Maxim:
27-Oct-2010
I'd just rename the rebol BOOL to some other Identifier,and do a 
quick recursive file replace... I looked and its not used that much.
Group: Core ... Discuss core issues [web-public]
BrianH:
14-May-2011
This would mean that you would replace this code:
    saved: system/options/binary-base
    system/options/binary-base: 64  ; or 16, whatever
    output: mold data
    system/options/binary-base: saved
with this:
    output: mold/with data [binary-base: 64]


This saves code since you can't trust that any global option will 
remain even its default value without data flow analysis unless it's 
protected.
Maxim:
26-May-2011
I wish compose/deep didn't copy/deep the whole block when it did 
its composing.  


I don't know how it is in R3, but in R2, to simply replace one value 
in tree, you have to copy the whole tree, which isn't very useful.
Oldes:
19-Dec-2011
The behaviour is correct (it's not just replace/all). The dictionary 
must be bad as it does not modify.
Group: !REBOL3 Proposals ... For discussion of feature proposals [web-public]
BrianH:
14-Jan-2011
Alas, that kind of problem is exactly why you don't want to rely 
on the implementation model of the GC. One thing we know about the 
GC is that it is the stop the world type. If we need to solve the 
problem you mention, we would have to completely replace the internal 
memory model with a different one and use a GC with a completely 
different algorithm (generational, incremental, parallel, whatever). 
That means that all of your code optimizations would no longer work. 
If you don't try to optimize your code to the GC, it makes it possible 
to optimize the GC itself.
BrianH:
20-Jan-2011
I am trying to determine whether it would be acceptable to replace 
== with =? in decimal code where exact comparison is needed. Otherwise 
we would need to switch to prefix form if this proposal goes through, 
which math people don't necessarily like, or come up with operators 
for the equiv line.
Group: Red ... Red language group [web-public]
BrianH:
29-Mar-2011
Doc, if Red/System doesn't need to be Unicode-aware, you should replace 
the string! type in it with a binary! type and just have compiler-resolved 
string-to-binary conversions of string literals in the source. Have 
real strings only exist at the Red level.
Dockimbel:
29-Mar-2011
Max: if you need to make commas LOAD-transparent in a string!, it 
is as easy as: replace/all string "," " "
Kaj:
4-Apr-2011
Anyway, either attract a new community in Google Groups, or replace 
it with something that can compete with AltME, but don't complain 
that people won't trade AltME for Google Groups
Dockimbel:
21-May-2011
Kaj: I pushed a few fixes and changes on ALIAS support, it now behaves 
strictly as described in the specification. For the 0MQ binding, 
you need to replace [struct! message!] occurences with [message!] 
to make it compilable with the new version.
Kaj:
2-Jun-2011
To get a handle on why Red/System tries to replace C, I think it's 
interesting to compare this function prototype:
Dockimbel:
3-Jul-2011
Kaj: we have decided to replace the "struct" and "pointer" by "declare". 
Please read this post: http://groups.google.com/group/red-lang/browse_thread/thread/9c407676e2335919?hl=en
Dockimbel:
8-Aug-2011
If someone has a better proposition for 'typeinfo, I am ready to 
replace it.
Kaj:
5-Sep-2011
Detecting aliases would be very nice. It would replace GTK's RTTI, 
which is complex and buggy, and obviously wouldn't work cross-toolkit
Andreas:
7-Jan-2012
And as Kaj already said as well, Red/System is actually not only 
to "evolve into general C wrapper?", it is meant to actually replace 
C (for some purposes). Red/System aims to interface nicely with native 
libraries (which are, more often than not, created by using C).
Dockimbel:
24-Jan-2012
Pekr: the link you're giving is the exact same article I've pointed 
to in 2), it just have a left menu added for quicker navigation, 
but that's the same article. If I haven't just stopped on this algorithm, 
it's because of the initial warning at the beginning: 


This article is obsolete. Its replacement - which will fix some errors 
and better explain the relevant issues - is being crafted as a multi-part 
series


And from Dawson's blog: "Years ago I wrote an article about how to 
do epsilon floating-point comparisons by using integer comparisons. 
That article has been quite popular (it is frequently cited, and 
the code samples have been used by a number of companies) and this 
worries me a bit, because the article has some flaws. I’m not going 
to link to the article because I want to replace it, not send people 
looking for it." 


So it appears that there are some errors (probably some edge cases 
not handled properly).
Dockimbel:
14-Feb-2012
After using `??` a few hours, I realized that it was a mistake to 
use it as a shortcut for `print-line`. It is readable when used on 
a word, but with a block, it looks too esoteric and hurt the feelings 
of old rebolers that see it as a syntax error. So, I want to get 
rid of `??` but can't find anything to replace it that would be both 
short and consistent with `print`and `print-line`. I think that I'll 
just deprecate `??` but won't remove it for now as some of you are 
heavily using it.
Dockimbel:
17-Feb-2012
Kaj, in any case, you can just replace #{037B} by #{037F} in IA-32.r 
at line 20: 

    fpu-flags: to integer! #{037B}
Group: SQLite ... C library embeddable DB [web-public].
Sunanda:
12-Mar-2011
[New group to replace the old one that was somehow causing AltME 
resync problems]
Previous postings are here:
    http://www.rebol.org/aga-display-posts.r?post=r3wp439x1
Group: World ... For discussion of World language [web-public]
Maxim:
9-Dec-2011
my only suggestion for structures...  make it so the semantics are 
exactly the same as C.    
i.e. you take a C header file, and do:

replace/all header-string "{" "["  
replace/all header-string "}" "]"  
replace/all header-string "char *" "pointer"
...


and basically you've got your simplest World version of the spec 
 ;-)
Group: REBOL Syntax ... Discussions about REBOL syntax [web-public]
Steeve:
14-Feb-2012
replace some by any
Steeve:
18-Feb-2012
test-syn: func [
	chars [bitset!] sample [string!]
	/local c l t? ci
][
	t?: type? first to-block sample
	repeat i 256 [
		c: replace copy sample "?" ci: to-string to-char i - 1
		if find ci chars [
			if error? l: try [to-block c] [
				l: disarm l
				l: reform [l/id l/arg1 l/arg2]
			]
			if any [1 <> length? l t? <> type? l/1][
					print [i - 1 mold to-char i - 1 mold l attempt [type? l/1]]
			]
		]
	]
]
BrianH:
23-Feb-2012
I've been hoping to fix that. I can load a hot-patch into R2, and 
include a patch in a host kit build in R3 or replace functions from 
%rebol.r if necessary.
801 / 85212345678[9]