• 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
r4wp1023
r3wp10555
total:11578

results window for this page: [start: 2401 end: 2500]

world-name: r3wp

Group: Core ... Discuss core issues [web-public]
JaimeVargas:
7-Apr-2005
If anyone ever wanted multi-methods or function overload in rebol 
here is the answer. Enjoy ;-)

REBOL []

define-method: func [
	'name [word!] spec [block!] locals [block!] code [block!]

 /local w type-rule spec-rule continue? register-name methods-name
][
	;; first validate the spec
	continue?: [none] ;used to stop parsing

 type-rule: [set w word! (unless datatype? attempt [get w] [continue?: 
 [end skip]])]
	spec-rule: [some [word! into [type-rule continue?]]]
    unless parse spec spec-rule [make error! "invalid spec"]

	register-name: to-word join :name '-register
	methods-name: to-word join :name '-methods?
	unless value? name [
		
		context [
			dispatch-table: copy []
			
			spec-fingerprint: func [spec [block!] /local types][
				types: copy []
				foreach itm extract/index spec 2 2 [insert tail types itm/1 ]
				types
			]
			
			values-fingerprint: func [values [block!] /local types][
				types: copy []
				foreach v values [insert tail types type?/word v]
				types
			]
			

   retrieve-func: func [values [block!]][select/only dispatch-table 
   values-fingerprint values]
			
			set :name func [values [block!]][
				do compose [(retrieve-func values) (values)]
			]
			
			set :register-name func [spec code /local fingerprint pos][
				fingerprint: spec-fingerprint spec
				either found? pos: find/only dispatch-table fingerprint [
					poke dispatch-table 1 + index? pos function spec locals code
				][

     insert tail dispatch-table reduce [fingerprint function spec locals 
     code]
				]
			]
			
			set :methods-name does [probe dispatch-table]
		]
	]

	do reduce [register-name spec code]
]

define-method f [x [integer!]] [] [x + 1]
define-method f [s [block!]] [] [attempt [pick s 2]]
define-method f [x [decimal!]] [] [sine x] 

f[5] == 6
f[[one two three]] == two
f[90.0] == 1.0
Gregg:
8-Apr-2005
Please do put them on REBOL.org! No bookmarks in AltME yet, and others 
will find them there.  Wish I had time to play with them right now!
Brock:
15-Apr-2005
Is this a bug?

1)  I read a directory on our ftp server and return a set of files 
of which  02 EN AR final.pdf is one of them

2)  I then copy a URL address that returns a 404 indicating it couldn't 
find the file in question ie.  http://www.cpcpension.com/files/2002EN AR final.pdf

3)  I do a  split-paths to-url on the contents of the clipboard:// 
that contains item in step 2)

4)  I compare the file names for equality either using "=" or equal? 
and both return false
5)  I check the type of each file, they are both 'file' types

6)  I check the length of each file, the one from step 1) returns 
20, step 2) returns 26


So, somewhere it is changing the   representation of a space into 
the actual string " ".
Any ideas?
6)
Vincent:
15-Apr-2005
Brock: 'to-url converts a string into an url without escaping, escaping 
is only done when showing the url string: 

to-url "http://www.cpcpension.com/files/2002EN AR final.pdf" ; works 

== http://www.cpcpension.com/files/2002EN AR final.pdf ; blanks 
->  

to-url "http://www.cpcpension.com/files/2002EN AR final.pdf" 
; don't works

== http://www.cpcpension.com/files/2002EN AR final.pdf ; only 
looks the same, but contains "%" "2" "0"
you can use 'do or 'load to interpret the string in clipboard:
do read clipboard://
load read clipboard://
(same with 'to-file)
sqlab:
27-Apr-2005
Hi Claude, 
do you want to get the names of the columns?

You do not get them by default.

If you want just the names of the columns of a table, you should 
do like this
insert stm ['columns "filexxx"]
foreach column copy stm [probe column]

look at 
sdk/doc/database.html#section-4.2


But beware, Rebol/Command does not support all datatypes, so maybe 
you will get some problems.

Also depending how strict/relaxed your db system is "filexxx" should 
be written "FILEXXX" or as a fully qualified name.
So better check with 
insert stm ['tables] 
what your db system expects.


If you write a program, it is recommended, to name every column you 
want to get in your result set. Then you know the names too .
Group: Parse ... Discussion of PARSE dialect [web-public]
BrianH:
22-Aug-2005
If you want to guarantee progress with my and your examples (and 
better support multichar markup tags) change the last
  any non-markup
to
  any non-markup | skip
and that would do it.
Graham:
21-Sep-2005
How do you parse for a particular integer value ?

parse [ -1 ] [ integer! ]

but I want

parse [ 1] to fail ...
Ladislav:
11-Oct-2005
(but this one deserves to be put to Rambo too - do you want me to 
put it there?)
Graham:
11-Oct-2005
well, if people want to come to Wellington .. I'll see what I can 
do.
MichaelB:
23-Oct-2005
I just found out that I can't do the following:
s: "a b c"
s: "a c b"
parse s ["a" to ["b" | "c"] to end]


The two strings should only symbolize that b and c can alternate. 
But 'to and 'thru don't work with subrules. It's not even stated 
in the documentation that it should but wouldn't it be natural ? 
Or am I missing some complication for the parser if it would support 
this (in the general case indefinite look-ahead necessary for the 
parser - is this the problem?) ? How are other people doing things 
like this - what if you want to parse something like "a bla bla bla 
c" or "a bla bla bla d" if you are interested in the "bla bla bla" 
which might be arbitrary text and thus can't be put into rules ?
Izkata:
23-Oct-2005
Michael>I just found out that I can't do the following:
s: "a b c"
s: "a c b"
parse s ["a" to ["b" | "c"] to end]<

parse s ["a" [to "b" | to "c"] to end]
Volker:
1-Nov-2005
to me it sounds like "do somewhing", not just continue.
Graham:
1-Nov-2005
It means I can do this

if ( clause ) |
break

I guess to exit the rule.
BrianH:
1-Nov-2005
I didn't do a really useful example, just one to demonstrate the 
current way of faking the behavior.
Example:  [if (test) | ...]
Fix:  [(unless test [dummy: [end skip]]) dummy | ...]
BrianH:
4-Nov-2005
Do you want to do a full rule-based parse here, or will simple parse 
do?
data: read/lines %data
foreach rec data [
    rec: parse/all rec "|"
    switch rec/1 [
        "OBX" [ ... do stuff...
Graham:
4-Nov-2005
I admit it is likely to be easier to do it your way.
sqlab:
4-Nov-2005
Do you want to do your mapping in the database or with Rebol?
BrianH:
4-Nov-2005
Again, if you are just matching a single character or a fixed string, 
it is better and faster to just match it instead of matching a charset 
of that character. You don't need the caret, non-caret, pipe and 
nonpipe charsets you have above - the strings "^^" and "|" will do 
just as well.
Geomol:
2-Jan-2006
It's not a good example. You could do something like:


>> parse {<H1>A heading</H1>} [copy heading ["<H" ["1" | "2" | "3"] 
">" to "</"]]
== false
>> heading
== "<H1>A heading"
Sunanda:
12-Jan-2006
No....I suspect they each have core abilities they excel and other 
things they can only do with ugly workarounds, if at all.
It'd be interesting to see experts bringing out the best in both.
Volker:
1-Mar-2006
i think that is hard to do perfectly. for example "\"", how to parse 
that?
Oldes:
1-Mar-2006
I know it woud be possible to improve my dialect, but I'm not going 
to do it in near future, I'm already used to write it this way:)
Volker:
1-Mar-2006
But chars like # are easier to search/replace. But i dont defend 
my solution, yours looks ok.
Do you write your dialect-code in rebol-blocks or in a string?
Group: Rebol School ... Rebol School [web-public]
denismx:
27-May-2007
I can read the code. The thing is I have yet to get to a point where 
I can sit down and start thinking code to do things.
Geomol:
22-Jun-2007
To everyone:

What characterize a good learning book? Do you prefer thick books 
with deep explanation and many examples, or do you prefer the thin 
book with the essentials? Look at your collection of technical book; 
about computer languages, OSs, databases or what you have. Which 
ones do you like, and which ones is no-good?
PatrickP61:
25-Jun-2007
I'm a newbie and wanted to ask this question on a simple rebol program. 
 If I have a variable COUNT and I wanted to write this value with 
a literal could I do this:  write OutFile [Count " Total lines"]/append. 
 But the word Count is not evaluated and I get "Count Total lines" 
instead of "8 Total lines".  What do I need to tell rebol to return 
the value of COUNT?
Rebolek:
25-Jun-2007
If you do not want to evaluate everything, use compose:
compose [(count) " Total lines"]
Geomol:
25-Jun-2007
A suggestion: Many words in REBOL can do more than one thing, sometimes 
depending on data-type of the argument or the use of refinements. 
It's almost impossible to remember it all. So as a new one to the 
language, check the help for the new words, you're learning. Like
>> ? reduce
>> ? compose
PatrickP61:
25-Jun-2007
As a newbie, what suggestions do you have for me to debug my rebol 
scripts.  For example, I have a script called "Convert_to_Table" 
that I am just starting to write.  I can execute it -stand alone- 
and see the results of the run, but what I would like to do is be 
able to see what the console has for any values.  In other words, 
when I double click the "Convert_to_Table" I can see the results 
but not ask the console questions like print Count or the like.  
How do you suggest a newbie debug a script?  Should I go into console 
first and then perform a "do Convert_to_Table" and then be able to 
ask questions of console, or is there another way?.
PatrickP61:
25-Jun-2007
P.S.  In AltMe, what do you guys type to get a carriage return without 
sending the AltMe message until you do an <enter>
PatrickP61:
25-Jun-2007
Ahhh so much to learn and not enough time!!!  Thanks for your patience
Ok, on to another issue.


I have a text file as a printable report that contains several pages 
within it.  Each line can be as large as 132 columns wide (or less).

- The literal  "    Page " will begin in column 115 and that indicates 
the start of a printed page.


I want to write a script that will read this text file one-page-at-a-time, 
so I can do some processing on the page.


How do I write a script to load in a single "page"?  I am guessing 
that I need to open a PORT and have rebol read all the lines until 
I get "....Page." in bype position 115.

Any suggestions?
Gabriele:
27-Jun-2007
prin will insert a space though, so you may want to do   print join 
"---" count   instead.
Gregg:
28-Jun-2007
To match your ruler, do:  make-ruler 25
PatrickP61:
28-Jun-2007
Gregg -- I dont know how to reveal the binary/ascii values of the 
file, but the spanish y looks like it may be hex FF.  Do you have 
rebol code that can convert the characters into hex?
PatrickP61:
2-Jul-2007
Now that I think of it, I probably do not need to manuipulate a Count 
variable  -- I can probably use INDEX right?
PatrickP61:
5-Jul-2007
Situation:	I want to read in an input file and parse it for some 
strings

Current:	My test code will do the parsing correctly IF the input 
block contains each line as a string

Problem:	When I try to run my code against the test file, It treats 
the contents of the file as a single string.

Question:	How do I have Rebol read in a file as one string per line 
instead of one string?
In-text:	[	"Line 1                        Page     1"
		"Line 2    Name      String-2"          
		"Line 4    Member    String-3 on 12/23/03"
		"Line 5    SEQNBR    abcdef               "                
		"Line 6       600    Desc 1 text         12/23/03"
		"Line 7      5400    Desc 2    Page 4    12/23/03"
		"Line 8    Number of records searched	]
 Get-page:		[thru "     Page "	copy Page-id to end]
 Get-file:		[thru "Name  "		copy Name-id to end]
 Get-member:	[thru "Member  "	copy Member-id to end]

 Page-id:	Name-id:	Member-id:	"-"

 for N 1 length? In-text 1 [
	parse In-text/:N	Get-page
	parse In-text/:N	Get-file
	parse In-text/:N	Get-member
	] 
 print	[ "Page"	Page-id		]
 print	[ "Name"	Name-id		]
 print	[ "Member"	Member-id	]
PatrickP61:
5-Jul-2007
Tomc  -- This version means that I need to have the entire file read 
in as a string -- Not with Read/Lines -- Because the newline will 
the the "delimiter" within the string while the Read/Lines will delimit 
each newline to a separate string inside a block.  Do I have that 
right?
Sunanda:
6-Jul-2007
Not sure this is a case for parse......You seem to have four types 
of line:
-- those with "page" in a specific location on the line
-- those with "name" in a specific location on the line
-- those with "member" in a specific location on the line

-- others which are to be ignored .... eg your orginal line 6 "Line 
6       600    Desc 1 text         12/23/03"

What I would do is:
* use read/lines to get a block

* for each line in the block, identify what record type it is by 
the fixed literal .... something like: if "page" = copy/part skip 
line 25 4 [....]

* perhaps use parse to extract the items I need, once I know the 
line type
***

If you just use parse in the way you propose, you run the risk of 
mis-identifying lines when there is a member called "page" or "name"
PatrickP61:
6-Jul-2007
Thank you Sunanda -- I will give that a try.


Just to let you know -- My goal is to convert a printable report 
that is in a file into a spreadsheet.
Some fields will only appear once per page like PAGE.

Some fields could appear in a new section of the page multiple times 
like NAME in my example.
And some fields could appear many times per section like MEMBER:
_______________________
Page header          PAGE     1
Section header     NAME1.1
Detail lines            MEMBER1.1.1
Detail lines            MEMBER1.1.2
Section header     NAME1.2
Detail lines            MEMBER1.2.1
Detail lines            MEMBER1.2.2
Page header         PAGE    2
(repeat of above)____________


I want to create a spreadsheet that takes different capturable fields 
and place them on the same line as the detail lines like so...
______________________
Page   Name       Member
1          NAME1.1  MEMBER1.1.1
1          NAME1.1  MEMBER1.1.2
1          NAME1.2  MEMBER1.2.1
1          NAME1.2  MEMBER1.2.2

2          NAME2.1  MEMBER2.1.1  ...    (the version numbers are 
simply a way to relay which captured field I am referring to (Page, 
Name, Member)


Anyway -- that is my goal.  I have figured out how to do the looping, 
and can identify the record types, but you are right about the possiblity 
of mis-identifying lines.
PatrickP61:
6-Jul-2007
This is my pseudocode approach:


New page is identified by a page header text that is the same on 
each page and the word PAGE at the end of the line

New section is identified by a section header text that is the same 
within the page and the text "NAME . . . . :"

Members lines do not have an identifying mark on the line but are 
always preceeded by the NAME line.

Member line continue until a new page is found, or the words "END 
OF NAME" is found (which I didnt show in my example above).


Initialize capture fields to -null-     like PAGE, NAME
Initialize OUTPUT-FLAG to OFF.

Loop through each line of the input file until end of file EOF.
/|\	If at a New-page line
 |	or at end of Name section
 |		Set OUTPUT-FLAG  OFF
 |	If OUTPUT-FLAG  ON

 |		Format output record from captured fields and current line (MEMBER)
 |		Write output record
 |	IF at New Name line
 |		Set OUTPUT-FLAG ON
 |	IF OUTPUT-FLAG OFF
 |		Get capture fields like PAGE-NUMBER when at a PAGE line
 |		Get NAME when at a NAME line.
 |____	Next line in the file.
Tomc:
7-Jul-2007
Yes Patrick you have it right. The rules I gave would fail 
since you have multiple names/members

I would try to get away from the line by line mentality 
and try to break it into your conceptual record groupings
file, pages, sections, and details...

One trick I use is to replace a string delimiter for a record 
with a single char so parse returns a block of that record type. 

this is good because then when you work on each item in the block 
in turn
you know any fields you find do belong to this record and that 

you have not accidently skipped to a similar field in a later record.

something like this 


pages: read %file
replace/all/case pages "PAGE" "^L"
pages: parse/all pages "^L"

foreach page pages[
	p: first page
	page: find page newline
	replace/all/case page "NAME" "^L"
	sections: parse page "^L"
	foreach sec section [
		s: first section
		sec: find sec newline
		parse sec [
			any [thru "Member" copy detail to newline 
				newline (print [p tab s tab detail])
			]
		]
	]
]
PatrickP61:
18-Jul-2007
My goal is to be able to control how much of a file is loaded into 
a block then process the block and then go after the next set of 
data.  That is why I am using PORT to do this function instead of 
reading everything into memory etc.
PatrickP61:
26-Jul-2007
So if i read you right, then if I didn't do new-line/all, and tried 
to probe Out-block, it would show the entire contents as one large 
string, whereas new-line/all will allow probe to show each value 
as a spearate line.  Right?
PatrickP61:
26-Jul-2007
Anton, I understand Rebolek answer, but I want to understand your 
answer too.

 I'm wondering about the line: repeat N -1 + length? Blk [append append 
 Line Blk/:N tab]  

does Rebol do the inner append first  (in math expressions) like 
this:  [append ( append Line Blk/:N ) tab]
and then do this for the number of "lines" in the array
N	Out-block
0	[]
1	"Col A1^-Col B1"
2	"Col A1^-Col B1"	"2^-3"
3	"Col A1^-Col B1"	"2^-3"	{line "3"^-col "b"}


I think I see the above progression, but not sure about Blk [append 
Line last Blk]  Is this advancing the starting position within In-array?
Vladimir:
3-Oct-2007
pixel_face: make face [
    size: pixel_size
    edge: none
	color: black
    data: 0
]

...

pane-func: func [face index] [
    index: (index - 1)
    either integer? index [
        if index < ((grid_size/x) * (grid_size/y)) [
        	xx: (index // (grid_size/x)) + 1
        	yy: to-integer ((index / (grid_size/x)) + 1)
            pixel_face/data: index
            pixel_face/offset/y: ((yy - 1) * (pixel_size/y))
            pixel_face/offset/x: ((xx - 1) * (pixel_size/x))
            pixel_face/color: pick paleta sprite-colors/:yy/:xx
            return pixel_face
        ]
    ][
 ;       return to-integer index/y / 20 + 1
    ]
]

key-event: func [face event] [
    if event/type = 'key [
	            switch event/key [
                        up [cursor_y: cursor_y - 1]
	            		down [cursor_y: cursor_y + 1]
                        left [cursor_x: cursor_x - 1]
                        right [cursor_x: cursor_x + 1]

                       ]
           		sprite-colors/:cursor_y/:cursor_x: 2
	            show grid
            ]
    if event/type = 'time [
		? now/time
    	cursor_color: (3 - cursor_color)
   		sprite-colors/:cursor_y/:cursor_x: :cursor_color
        show grid
	]
    event
]
 
insert-event-func :key-event

grid: make face [
    offset: ((screen_size - window_size) / 2)
    size: window_size
    rate: 00:00:05
    color: blue
    effect: [gradient]
    pane: :pane-func
]

view/new grid
do-events
Vladimir:
3-Oct-2007
But, why? Ohhhh why do I need to do it like that? :)
Vladimir:
4-Oct-2007
I'm actually interested only in keypress events...

But I have to limit the rate of events... I know there is the rate 
element in every face, and I did make it work for time event and 
that is ok.
But I couldn't make keypress event occur in timed intervals.

I'm not saying I have to have it. Maybe it just isnt supossed to 
be. But it says in docs:


The focal-face must be set to a valid face object (one that is part 
of a pane in the face hierarchy) and the system/view/caret (explained 
in next section) must also be set in order to:
   1. Receive keyboard 
events ....

So I put this inside engage func:

system/view/focal-face: face
system/view/caret: tail ""


And now it works... I dont even use caret but you have to set it 
to some bogus value!


So in my opinion rate element has no influence on key events (if 
I type like crazy I get 19 key events for 1 second...).

But I can make some sort of counter and simply do keypress response 
only when I want to...
Pekr:
26-Oct-2007
before you do so though, please try to configure your mail client 
(FireBird, Outlook), to see what kind of setting you are heading 
for, as the problem as well can be related to some other issue :-)
Vladimir:
26-Oct-2007
I found it! :)
all you need to do is add info in set-net fields....
instead of this:
set-net [[user-:-mail-:-com] smtp.mail.com pop3.mail.com]
use this:

set-net [[user-:-mail-:-com] smtp.mail.com pop3.mail.com none none none 
"user" "pass"]

Im happy :)
Gregg:
29-Oct-2007
There are a lot of ways you could do it, FTP, LNS, AltMe file sharing, 
custom protocol on TCP. It shouldn't be hard, but I would try to 
use something existing. The devil is in the details.
Graham:
29-Oct-2007
I think Carl posted some code on how to do huge file transfers.
BrianH:
28-Jan-2008
File I/O with binary file structures needs better conversion facilities 
than REBOL has, at least to do efficiently.
Gregg:
31-Jan-2008
If you want to get a job as a grunt programmer in a big company, 
using whatever tools they tell you are in fashion, REBOL is not the 
right tool for you--though it may be a nice support language. If 
you want to think about hard problems and algorithms, it's as good 
as Lisp/Scheme within limits (e.g. tail recursion), and easier to 
play around with. If you want to get the job done and either make 
the tool call yourself, or can convince the people who do that REBOL 
is up to the task, it's great. And if you aren't a CS major, but 
know that computers and programming will affect you in business, 
and you want to be able to to some "light" programming, I think it's 
great.
Rod:
31-Jan-2008
I think REBOL has merit in the classroom but it can't be from the 
angle of what you need to be an IT programmer.  It has to be more 
about theory and creativity to make machines do amazing things.  
I am afraid though that your all or nothing situation and be ready 
by the fall schedule doesn't sound like a good combination.  You 
would want some real world, already done it here in this setting, 
kind of platform to start from to move into that kind of education 
space.
Vladimir:
28-Mar-2008
I want to upload file on ftp. 
I know I can do it like this:
write/binary ftp://user:[pass-:-website-:-com] read/binary %file

Or I am supossed to do it.... it just wont let me....


>>  write/binary ftp://user:[pass-:-ftp-:-site-:-com] read/binary %file.txt
** User Error: Cannot open a dir port in direct mode

** Near: write/binary ftp://user:[pass-:-ftp-:-site-:-com] read/binary %file.txt

I can read the contents of ftp rootdir with:
print read ftp://ftp.site.com/


But writing is not working.... What does it mean: "Cannot open a 
dir port in direct mode"?
Vladimir:
30-Oct-2008
I noticed UDP disabled in my router configuration... could it have 
something to do with my problem?
Pekr:
30-Oct-2008
do you have any other account to try?
Pekr:
1-Nov-2008
As for your load balancer device - do you use two WANs connected 
to two providers? If so, you have to choose session balancing type, 
or some of your apps might not work (e.g. ICQ will disconnect you, 
when you go out via two different public IPs in one session)
Vladimir:
4-Nov-2008
basicly if I enter Binary mode, upload fails and it looks like it 
has to do something with port above 35000 problem.
If I enter passive mode nothing works....
it always responds with network timeout....
DideC:
4-Nov-2008
It seems the problem is after the PORT command.

It  define the port used to receive or send the file data (depending 
the command you issue).

Use Wireshark to have a look to what Total commander do regarding 
its PORT command.
So we can compare with the Rebol commands.


I guess the router firewall block the one Rebol use, but Total commander 
do it in an over way.
Group: rebcode ... Rebcode discussion [web-public]
Volker:
25-Oct-2005
I do like it if your opinion is not choosen, as long as mine is! 
Have to look if i like democracy now. :)
Group: Tech News ... Interesting technology [web-public]
Pekr:
12-May-2006
in fact, I am one of two "right hands" (it is a saying in czech language) 
for our CTO. And the reason is, that I provide him with opinions 
not tied to any products of my liking. Our Delhi group, would do 
everything in Delphi, our Lotus Notes group, would do everything 
in Lotus Notes, the same goes for VB and SAP folks, and of course, 
jokingly, I would do everything in Rebol. But - things need some 
level of understanding of current/historical situation in the company.
Pekr:
12-May-2006
Graham - actually I thought about "porting" Rails to rebol and calling 
it "rebol on trails" :-) But last time looking at rails api, it is 
already large jog done. OTOH we would only clone API that already 
exists ... dunno ....  because whole web 2.0 mess is here, to be 
finally able to do what REBOL/View can do, just using browser ...
Volker:
13-May-2006
Thats what forth does with meta-compilers and squeak does with slang. 
Ugly, so a pretty good motive to do most in meazzines :)
Terry:
14-May-2006
How can you say you don't need to alter the db.. when the second 
step needs code like this?.. 
class AddUserTable < ActiveRecord::Migration
  def self.up
    create_table :users do |t|
      t.column :first_name, :string
      t.column :last_name, :string
      t.column :birthday, :date
    end
  end

  def self.down
    drop_table :users
  end
end
Terry:
14-May-2006
And not only does it need to be modified.. the syntax to do so is 
archaic.
JaimeVargas:
15-May-2006
Volker here is another example,



anyF: does [f g h
]

f: func[x][print "f third" 2 * x]

g: func[y][print "g second" y + 1
]
h: func[][print "h first" 1]


anyF ;; == f(g(h()))

;; 

now lets change 


g: does [print "g second" 5

]

anyF ;; == produces something like f(g()) h()


  anyF is compilable only if the order of evalutation 
doesn't change 
  at runtime. 

Rebol permits for the order of evalution to be determined 
  
by the context in which anyF is run, and the interpreter is 
smart 
  enough to GC the unconsumed values.


   This is a feature of Rebol because with the same expression 
you 
   can have two very different meanings, the disambiguation 
of the 
   grammar is provided by the context (or environment). 
This allow 
   Rebol to support easy Dialecting. That is each 
DSL may need specific 
   evaluation orders, aka semantics, 
while they share the same code 
   expression. In this case [f g h].



In the example above two different branches of the AST three 
were 
followed. But by just looking at [f g h] is impossible
to know which 
branch will be taken. 


  Other compilable languages enforce the order of evaluation by 
using 
  specific syntax forms to determine what is an expression. 
 Lisp 
  uses  parens, while  C semicolons and others markers.

 


So in order to make anyF compilable we need to  enforce the 
order 
of evaluation.  One possibilty  is to use Rebol parens.



anyF: does [(f) (g) (h)] ] *** see note


  The cost is evaluation speed for the interpreter, and now 
we are 
  back at using parens at each step. Which is what 
lisp uses. Should 
  we go back to 1967?


  The alternative of JIT is possible, but  it requires hinting and 
  
a sofisticated runtime environment. The translation of Rebol 
code 
  to some an  internal VM like rebcode  is simpler and maybe 
sufficient, 
  otherwise extending rebol via DLLs  is the way to 
get closer to 
  the metal. However, I don't see an easy path 
to having a Metacircular 
  Rebol. If you do, I hope you write
 a Rebol compiler and share it 
  with us ;-)
Pekr:
15-May-2006
Does it mean we can use Flash IDE tools to do animations, save them 
as curves and then possibly render it using AGG 2.4 in View? :-)
Volker:
15-May-2006
No, that is a problem with an intentionally limited quick POC.
But i had to blink twice. :)

It currently expectes that all expressions start with a word. Now 
tuneme2 is  [(append 7) (append add) 5 6].
And it fails. As it should with this limited subset. 
Found it after adding a probe,
      arglist: first get probe first code 
which gave 5 on last run.

I do think  i can match rebol completely (means a rebol with small 
additions/restrictions).

Its as tricky as to compile, say 'c. There are lots of exceptions, 
but in the end it is possible.
Pekr:
16-May-2006
hopefully Carl knows threads headaches (I do remember his long time 
ago post to ml :-) .... and will do it the right way ...
Volker:
17-May-2006
Geomol: someone exlain google *where* rebol is. They do this because 
ajax-the-runtime is everywhere, but seemingly the worst way to code.
JaimeVargas:
17-May-2006
Gabriele, tasking without any explicit control  is risky. How do 
you handle two task both writting to the same file, who gets access 
to the resource, how you enforce determinism?
Gabriele:
18-May-2006
i need to read that paper jaime posted; anyway if it's just linda 
style, it's trivial to do with a server handling the tuple space.
JaimeVargas:
18-May-2006
Anton, Yes I read the last line and I agree with it. The question 
is what should Rebol do to takle the concept of concurrency and do 
it properly, like Erlang, Termite, or Mozart/Oz.
JaimeVargas:
18-May-2006
Volker, Do you really mean this "Complete determinism makes no sense 
with parallel IMHO", the idea of paralellism is to  be able to perform 
any computation  done by a sequential machine faster, a random paralell 
machine may have some uses, but none of the mainstraem ;-)
JaimeVargas:
18-May-2006
What sense makes perfect determinism with multiple physical inputs 
, like sensors or people entering data? The entries and their order 
is slightly off anyway

 You can still have deterministic computation even in such situation. 
 We do have that today with any multitasking OS. Or would you like 
 to have your programs to produce any random result?
Volker:
18-May-2006
No, i want my program to have s much determinism as needed. I call 
"perfect determinism" when i know "this stuff is done on cpu3, then 
the other thing a bit later on cpu4". That is perfectly repeatable. 
But that is not what i need. "this stuff is done on the next free 
cpu" is enough. But to do that, i need a language which can determine 
what this next free cpu is. And for that i need a general purpose 
language (counting cpus, acountig used time, priorities etc). While 
you said general purpose is not needed for a coordination language. 
But maybe i miss simething, maybe coordination means something different?
JaimeVargas:
18-May-2006
I never said that you need or not a general purpose language. As 
matter of fact, I don't think being general purpose has anything 
to do with concurrency. What I understand is than any new features 
that add concurrency  to  a language should do so in a manner that 
avoid non-deterministic results. Some languages have already accomplished 
 this goal, usually avoiding  threads. Threads operate more at  the 
OS level than the language one. So I hope R3 bring us good concurrency 
features, that ensure that our programs are deterministic, otherwise 
we could be shipping programs that at first glancelook correct and 
 will work, but could  fail later in production as the paper points 
out.
Pekr:
19-May-2006
Jaime - the paper, well. Still need to do some reading. But I do 
remember some liboop link page paper, which referred to another paper, 
where other guys were defending threads and "demystified" myth that 
tasks are better ....
Volker:
19-May-2006
Basically, he argues are lot that threads and shared memory can not 
work,

suggest alternatives Erlang has, mentions Erlang in one sentence, 
and says a real solution must work with mainstream-languages. The 
last point is a good one. But not in our case, because rebol is as 
non-mainstream as Erlang. So we need no hybrids, and lots of this 
arguments are moot.

This diagrams look to me a lot like some things connected by message-streams.

But i do not know how this MapReduce-library etc. works, maybe i 
miss something cool.
Henrik:
7-Jun-2006
the google way is cool if you have some work you do at home, which 
you want to continue on a netcafe or the library or just a place 
where you won't be for long
JaimeVargas:
14-Jun-2006
The good part is that you don't need to do any memory management. 
But I think you need to be familiar a bit with the Cocoa API, because 
F-Script wraps it into an smalltalk syntax.
Pekr:
21-Jun-2006
you are kidding, no? how can be Ajax and css easier to produce? in 
CSS you have to do it nearly manually (you said so to me some time 
ago :-)
Pekr:
21-Jun-2006
but it should not be the problem to do the same using rebol ... you 
remember Gateway's RT catalogue? Looked very nice for such kind of 
app ...
Pekr:
21-Jun-2006
isn't it because you are a web guy? You know how to do design, you 
have visual editor etc. What would be needed for you to turn it into 
comparatively looking rebol equivalent?
Ingo:
13-Jul-2006
Well, 1.0.7 was the last usabel version off FF. 1.5 Just keeps eatuing 
memory, is _slooooooow_ to do _anything_ (but eating memory ;-)
Robert:
14-Aug-2006
Not quite a news but IMO quite interesting: lukfil writes "We all 
know of floating point numbers, so much so that we reach for them 
each time we write code that does math. But do we ever stop to think 
what goes on inside that floating point unit and whether we can really 
trust it?"  http://rss.slashdot.org/~r/Slashdot/slashdot/~3/12335059/article.pl
Tomc:
17-Aug-2006
if you do need to add a bunch of floating point numbers begin with 
the smallest first and work your way up
Henrik:
3-Oct-2006
Mail can be good for ad hoc databases, but in my experience, keeping 
track of a conversation can be a bit of a nightmare if you are not 
careful, changing the subject line or something that will screw the 
thread up. This depends on how good the mail client is at threading. 
There is also a problem with certain mail clients not adhering to 
the Re: standard reply prefix for subjects.

Seeing how different people use mail clients very differently, it's 
hard to keep posts flowing in a readable way, if they continously 
decide that every mail needs a new subject, or the subject line is 
blank. This happens for people who are not accustomed to posting 
on mailing lists, where structure is very important. Unfortunately 
most customers that I deal with, do not use their mail clients efficiently, 
because they are unaware of the weaknesses of email. Email was designed 
in an era where sending text messages across phonelines were considered 
pretty high tech and was mostly used by technical people and only 
in select locations.


Just today I was looking for a mail inside an old thread, a response 
to a question I had asked a customer. I couldn't find it. It turned 
out that the customer apparently had never answered it, but I can't 
be sure whether I had accidentally deleted it or if the mail client 
had stowed it somewhere else. Mail just doesn't cut it anymore. It 
needs to be replaced with something much more rigid and with structure 
forced upon it by the clients. Significant protection from spam should 
be there by design, not by throwing advanced algorithms, money and 
CPU power at the problem.


This is why I like AltME. You have the instant messaging capability 
and I can still write long blurps like this one without loosing structure 
of an ongoing one-line conversations in the same thread (group in 
AltME). It'll end up in the right place. It's going to be very certain 
that you'll be able to read it a few seconds after I hit Send. It's 
logged and searchable, though it will scroll out of view quickly.
MikeL:
4-Oct-2006
Max,  GOod point ... I would like AltMe to have a "light weight thread" 
ability.  It needs a way to say which prior item (if any) you are 
dealing with (maybe selecting it before you start typing), a way 
to see that thread only, and a re-sort capability on "When Sent" 
to put it back in journal order.  It would also help if we can sort 
by User so that I can find all of the references by XXXX when someone 
says they are replying to them.  I guess Groups were intended to 
do some of that but there is so much good discussion captured that 
Groups aren't enough.  p.s. I'm sure Reichart thought about AltMe 
threading.
Terry:
28-Oct-2006
Some things are clearer with hindsight of several years. It is necessary 
to evolve HTML incrementally. The attempt to get the world to switch 
to XML, including quotes around attribute values and slashes in empty 
tags and namespaces all at once didn’t work. The large HTML-generating 
public did not move, largely because the browsers didn’t complain. 
Some large communities did shift and are enjoying the fruits of well-formed 
systems, but not all. It is important to maintain HTML incrementally, 
as well as continuing a transition to well-formed world, and developing 
more power in that world.

The plan is to charter a completely new 
HTML group. Unlike the previous one, this one will be chartered to 
do incremental improvements to HTML, as also in parallel xHTML. It 
will have a different chair and staff contact. It will work on HTML 
and xHTML together. We have strong support for this group, from many 
people we have talked to, including browser makers.

Tim Berners - Lee
Pekr:
13-Nov-2006
is there description of FB protocol anywhere? I mean - to do eventually 
tcp driver?
yeksoon:
13-Nov-2006
IBM, in that regard, even if they sold their PC business, has much 
more broader aproach ...

Pekr, I will try to answer from a marketing perspective.


Your statement suggest that a company with a broad based approach 
(diversified) in various markets is better than one with a narrow, 
focused approach.


My own study of companies suggest otherwise. I believe General Electric 
is one such case study. Throughout the 80s, they have acquired many 
companies across many industries, today... they have sell off a lot 
of the units that they have acquired.


Same goes with IBM. IBM is divesting their assets in a suitable time 
frame. They still have a 'broader approach' because of legacy baggages 
that they have not discard.


In fact, most companies that leads in their market segment do so 
because they are focused (during that time). SUN was focused on UNIX 
; Apollo did not.

MS was focused on PC; IBM says from mainframe to midrange to workstation 
to home PC....ironically MS is losing focus (do you think MS will 
win in the various new markets?)


It is not whether IBM has a broader approach that matters; it is 
about how fast IBM can reduce the excess baggages that it has acquired 
throughout the years.


SUN, in my opinion, is more focused than IBM now. At least , to me.... 
they own the 'datacenter' mindshare.


Corporates strategies facinates me. 2 of the most (fatal) management 
theories :

- diversifcation; why diversify when your core market is fragmenting...shouldn't 
you focus on one fragments instead? 

- convergence; eg. AOL-Netscape-TimeWarner...why do companies believe 
that different categories of business are coming together and not 
dividing further?


I, too make the mistakes above...and needs to clean up my 'business 
wardrobe'.
Maxim:
13-Nov-2006
but these things do evolve out of the market.  CEOs want their shares 
to go up, so they do what's trendy... not always what is the best.
Henrik:
15-Nov-2006
I won't do that, but if someone has time to spare, do that and post 
them on message boards which talk about this scripting language.
Gregg:
5-Dec-2006
For me, it isn't about the current state of VID widgets that are 
built-in--though a better UI toolkit for more advanced apps would 
be *very* welcome--it's about how easy it is to do other things, 
and do them all in one (very nice) language. I also tihnk we're still 
just scratching the surface of REBOL, in part because it's hard to 
build things to share, and not as easy to build larger systems. When 
our mindset is in small apps, there's much less benefit in building 
big frameworks, and even reusable components to some extent. i.e. 
it's often easier, today, to write things ad-hoc, rather than building 
up a library and environment for larger scale development.
Jean-François:
20-Dec-2006
I have been hopping for multi keyboard, mutli-mic input on one screen 
for long time..

I wonder why it took so long for someone to do this. Isn't it obvious 
that multiple mice would be usefull in many cases.

http://www.microsoft.com/presspass/features/2006/dec06/12-14MultiPoint.mspx
[unknown: 9]:
30-Dec-2006
I watched a program recently about crossing the street there.  The 
trick being to begin to cross, and keep your speed exactly the same 
at all times.  Which they demonstrated.  Two women holding hands 
(one was a westerner) cross the very wide street with motorcycles 
and mopeds and tiny cars whizzing by.  Scared me to simply watch 
it.


I suspect he paused, which would be something most of us that are 
not used to that might do.


It is a deep shame, as an absent minded professor, one of my big 
fears is being hit by a car.  I used to walk home at about 3:00 a.m 
almost every night.  My office and home were 3k apart.  The streets 
were completely empty, and so I felt somewhat safe from cars.  One 
night in deep thought I crossed the street (totally ignoring the 
state of the light) and was almost hit by a racing car.  Often, when 
I would arrive at home I simply could not remember walking at all, 
I was so deep in thought.
Maxim:
3-Jan-2007
why do the term semantic and markup used in the same sentence seem 
like an oxymoron to me?
Ingo:
4-Jan-2007
I've had a "croosing the street" experience once, too. 

I was in Paris and wanted to visit the Arc de Triomphe, all I could 
see was an 8 lane circular traffic around it, with no traffic lights 
whatsoever, and lots of cars speeding by, not paying attention to 
any of the markings on the street ....

On the other hand, I could see some people over there, where I wnated 
to be.

So after some cnotemplation, I decided, "Oh, well, this is France".

And I started started walking, and kept going, with all the cars 
beautifully flowing around me, just like magic.

It was a scary experience, and I wouldn't dare do this in Germany 
;-)
2401 / 1157812345...2324[25] 2627...112113114115116