• 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
r4wp178
r3wp2151
total:2329

results window for this page: [start: 1401 end: 1500]

world-name: r3wp

Group: View ... discuss view related issues [web-public]
amacleod:
10-Mar-2009
For some reason I can't get  %CORE_RL_wand_.dll to load using Oldes' 
save-image script. I have it in the same directory as the script 
and I tried it in the systemn folders...
error:
** Access Error: Cannot open CORE_RL_wand_.dll as library
** Where: context

** Near: lib_ImageMagickWand: load/library either system/version/4 
=
amacleod:
11-Mar-2009
From inside folder of the newer version I get a Visual C++ Runtime 
errror...

program ..rebol.exe

R6034

An application has made an attempt to load the C runtime library 
incorrectly.
Please contact the application's support team for more info..
Graham:
16-Mar-2009
if you're got an empty table or whatever, and you're wating for data 
to load ... do you think is better .. to hide the widget, and have 
a "loading...." or other busy indicator ajax like ... or flash up 
a flash ?
Gregg:
4-May-2009
REBOL []

; r/3 = 'activate = left-click
; r/3 = 'activate = rt-click+menu-item-sel

hex: func [
    {Returns the base-10 value of a hexadecimal number.}
    value [integer! string! issue!] "A hexadecimal number"
][

    ; Convert to an issue first, so integers can also be translated.
    to integer! to issue! value
]

make-elements: func [name count type /local result][
    if not word? type [type: type?/word type]
    result: copy "^/"
    repeat i count [
        append result join name [i " [" type "]" newline]
    ]
    to block! result
]

NOTIFYICONDATA: make struct! compose [
    cbSize  [integer!]
    hwnd    [integer!]
    uId     [integer!]
    uFlags  [integer!]
    uCallBackMessage [integer!]
    hIcon   [integer!]
    (make-elements 'szTip 64 #"@")  ; CHAR
] none
NOTIFYICONDATA/cbSize: length? third NOTIFYICONDATA

;change at third NOTIFYICONDATA 25 "New ToolTip!"
;probe NOTIFYICONDATA
;halt

;constants required by Shell_NotifyIcon API call:
NIM_ADD:     hex 0
NIM_MODIFY:  hex 1
NIM_DELETE:  hex 2
NIF_MESSAGE: hex 1
NIF_ICON:    hex 2
NIF_TIP:     hex 4
WM_MOUSEMOVE:       hex 200
WM_LBUTTONDOWN:     hex 201  ;   'Button down
WM_LBUTTONUP:       hex 202  ;     'Button up
WM_LBUTTONDBLCLK:   hex 203  ; 'Double-click
WM_RBUTTONDOWN:     hex 204  ;   'Button down
WM_RBUTTONUP:       hex 205  ;     'Button up
WM_RBUTTONDBLCLK:   hex 206  ; 'Double-click


;Public Declare Function SetForegroundWindow Lib "user32" (ByVal 
hwnd As Long) As Long

lib: load/library %shell32.dll

Shell_NotifyIcon: make routine! compose/deep [
    dwMessage [integer!]
    pnid      [struct! [(NOTIFYICONDATA)]]
    return:   [integer!]
] lib "Shell_NotifyIconA"


my-hwnd?: does [second get-modes system/ports/system [window]]

set-tray-tooltip: func [struct string] [
    change at third struct 25 string
    struct
]



system-awake: func [port /local evt][
    if all [evt: pick port 1  (evt/1 = 'tray)] [
        status/text: mold evt
        show status
;         if any [
;             (evt/3 = 'activate)
;             all [(evt/3 = 'menu)  (evt/4 = 'desktop)]
;         ] [
;             if not desktop-loaded [
;                 link-exec-start-desktop/force
;             ]
;         ]
;         if all [(evt/3 = 'menu)  (evt/4 = 'quit)] [quit]
    ]
    false
]

system/ports/system/awake: :system-awake
append system/ports/wait-list system/ports/system

view layout [
    style button button 200
    button "Add Tray Menus" [
        set-modes system/ports/system compose/deep [
            tray: [
                add main [

                    help: (rejoin ["REBOL/Link" any [""]]) ; tooltip

                    menu: [test: "Test" desktop: "Start Desktop" bar quit: "Quit"]
                ]
                add other [
                    ;help: (rejoin ["REBOL/Link" any [""]])
                    menu: [test-2: "Test-2" bar quit-2: "Quit-2"]
                ]
            ]
        ]
    ]
    button "Remove Tray Main Menu" [
        set-modes system/ports/system [
            tray: [remove main]
        ]
    ]
    button "Remove Tray Other Menu" [
        set-modes system/ports/system [
            tray: [remove other]
        ]
    ]
    ;button "Change Tray Other Menu" [
    ;    set-modes system/ports/system [
    ;        tray: [
    ;            change other [
    ;                help: "New Help!"

    ;                menu: [test-3: "Test-3" bar quit-3: "Quit-3"]
    ;            ]
    ;        ]
    ;    ]
    ;]
    button "Modify Tooltip" [
        nid: make struct! NOTIFYICONDATA none
        nid/hwnd: my-hwnd?
        nid/uid: 1
        nid/cbSize: length? third nid
        nid/uFlags:  NIF_TIP  ; NIF_ICON
        ;nid/hIcon:
        ;nid/szTip:  "New ToolTip!^@"
        set-tray-tooltip nid "New ToolTip A!"
        ;print mold third nid
        res: Shell_NotifyIcon NIM_MODIFY nid
        print [res to logic! res]
    ]
    button "Modify Other Tooltip" [
        nid: make struct! NOTIFYICONDATA none
        nid/hwnd: my-hwnd?
        nid/uid: 2
        nid/cbSize: length? third nid
        nid/uFlags:  NIF_TIP  ; NIF_ICON
        ;nid/hIcon:
        ;nid/szTip:  "New ToolTip!^@"
        set-tray-tooltip nid "New ToolTip B!"
        ;print mold third nid
        res: Shell_NotifyIcon NIM_MODIFY nid
        print [res to logic! res]
    ]
    button "Unview" [unview]
    status: text 200
]



free lib
Maxim:
12-May-2009
just remember to bind the func block to *view before submitting it 
to func

ex:  

view*: system/view
view*/wake-event: func [port ] bind [ 
	.... your wake event redefinition code ...
] in view* 'self


obviously you can mold/all + load  the wake-event func body directly 
or copy it from sdk code if you want.
Maxim:
16-May-2009
give me a minute... will load code to be sure I give a proper working 
example.
Pekr:
21-Aug-2009
Is there an easy way of how to resize an image? I tried:

i1: load %my-img.png
i2: make image! 82x63 i1

but the image is black :-)
Dockimbel:
21-Aug-2009
Untested, but should work :

i1: load %my-img.png
i2: make image! 82x63
draw i2 [image i1 0x0 82x63]
Nicolas:
20-Dec-2009
window: layout [i: image rate 5 load %gtfo.jpg key escape [halt]]

zoom-in: does [i/size: i/size * 5 / 4]
zoom-out: does [i/size: i/size * 4 / 5]
down: false
alt-down: false

insert-event-func [
	probe event/type
	switch/all event/type [
		down [down: true]
		up [down: false]
		time [if down [zoom-in]]		
		alt-down [alt-down: true]
		alt-up [alt-down: false]
		time [if down [zoom-in] if alt-down [zoom-out]]
	]
	center-face i
	show window
	event
]

view/options window [resize]
Nicolas:
20-Dec-2009
REBOL []


window: layout [i: image rate 5 load http://rebol.com/graphics/kits.jpg
key escape [halt]]

zoom-in: does [i/size: i/size * 5 / 4]
zoom-out: does [i/size: i/size * 4 / 5]
down: false
alt-down: false

insert-event-func [
	probe event/type
	switch/all event/type [
		down [down: true]
		up [down: false]
		time [if down [zoom-in]]		
		alt-down [alt-down: true]
		alt-up [alt-down: false]
		time [if down [zoom-in] if alt-down [zoom-out]]
	]
	center-face i
	show window
	event
]

view/options window [resize]
Geomol:
12-Jan-2010
Just a test:

set 'resize func [img /local sz c1 c3 i2] [
	if file? img [img: load-image img]

	scale: img/size/x / 160
	sz: as-pair 160 round img/size/y / scale
	c1: 1x0 * sz
	c3: 0x1 * sz


 i2: to-image layout [origin 0 box sz effect [draw [image img 0x0 
 c1 sz c3]]]
	save/png %img.png i2
]
Graham:
19-Feb-2010
user32: context [
    dll: load/library %user32.dll

    HWND_BOTTOM:    1
    HWND_TOPMOST:   -1
    HWND_NOTOPMOST: -2
    HWND_TOP:        0
   
    SWP_SHOWWINDOW: to integer! #{0040} ;&H40
    SWP_NOSIZE:     to integer! #{0001} ;&H1
    SWP_NOMOVE:     to integer! #{0002} ;&H2
   

    GetActiveWindow: make routine! [return: [integer!]] dll "GetActiveWindow"
    SetWindowPos:    make routine! [
        hWnd [integer!]
        hWndInsertAfter [integer!]
        X [integer!]
        Y [integer!]
        cx [integer!]
        cy [integer!]
        uFlags [integer!]
        return: [integer!]
    ] dll "SetWindowPos"
   
    set 'arrange-window func [
        "Arrange window z-order."
        window [object!]
        mode [word!] "One of BOTTOM, NORMAL, TOP or TOP-MOST"
    /local
        hWnd
    ][
        window/changes: 'activate
        show window
        hWnd: GetActiveWindow

        SetWindowPos hWnd do select [bottom HWND_BOTTOM top HWND_TOP top-most 
        HWND_TOPMOST normal HWND_NOTOPMOST] mode

            0 0 0 0 to integer! to-hex SWP_SHOWWINDOW or SWP_NOSIZE or SWP_NOMOVE
       
    ]
    	SetWindowText: make routine! [
		handle			[integer!]
		Title			[string!]
		return:			[integer!]
	] dll "SetWindowTextA"
	
	set 'WindowTitle func [
		Title [string!] 
	] [
		SetWindowText get-modes system/ports/system 'window Title
	]	
]
Ashley:
22-Feb-2010
This is the code I use for RebGUI:

get-fonts: make function! [
	"Obtain list of fonts on supported platforms."
	/cache file [file!] "Obtain fonts from file"
	/local s
] [
	all [cache exists? file] [insert clear fonts unique load file]
	if empty? fonts [
		either OS = 'Win [

   call/output {reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows 
   NT\CurrentVersion\Fonts"} s: copy ""
			s: skip parse/all s "^-^/" 4
			request-progress/title (length? s) / 3 [
				foreach [fn reg style] s [
					fn: trim first parse/all fn "("
					all [
						not find fonts fn

      not find ["Estrangelo Edessa" "Gautami" "Latha" "Mangal" "Mv Boli" 
      "Raavi" "Shruti" "Tunga"] fn
						not find fn " Bold"
						not find fn " Italic"
						not find fn " Black"
						not find fn "WST_"
						insert tail fonts fn
					]
					wait .01
					step
				]
			] "Loading fonts ..."
		] [
			call/output "fc-list" s: copy ""
			s: parse/all s ":^/"
			request-progress/title (length? s) / 2 [
				foreach [fn style] s [
					all [
						not find fonts fn

      (size-text make widgets/gradface [text: "A" font: make font [name: 
      fn size: 10]]) <>

      size-text make widgets/gradface [text: "A" font: make font [name: 
      fn size: 12 style: 'bold]]
						insert tail fonts fn
					]
					wait .01
					step
				]
			] "Loading fonts ..."
		]
	]
	sort fonts
]
Nicolas:
31-Mar-2010
Could I theoretically make my own 'system scheme with BIOS calls 
and load it instead of the default one?
Maxim:
15-Apr-2010
I know... its related to this specific draw block... I'm getting 
there...


I saved out the draw block to disk and when load it and use it within 
my tester, it crashes... 


so I'll reduce to the smalest example that crashes and dump it here.
Sunanda:
30-Oct-2010
load-image/clear
Oldes:
31-Oct-2010
Yes, but what if you don't want to load image yourself.. for example 
in this simplifed example:

write/binary %tmp.jpg read/binary http://www.rebol.com/graphics/carl1208-120.jpg
view layout [ image %tmp.jpg button "close" [unview/all]]

write/binary %tmp.jpg read/binary http://www.rebol.net/photos/carl3.jpg
;now there should be new image used, but it's not:
view layout [ image %tmp.jpg button "close" [unview/all]]
delete %tmp.jpg


I think that the solution is to clear the image cache on unview/all. 
What do you think?
Oldes:
31-Oct-2010
The only way how to clear the cache without loading new image is 
using:

write/binary %tmp.jpg read/binary http://www.rebol.com/graphics/carl1208-120.jpg
view layout [ image %tmp.jpg button "close" [unview/all]]
clear second second :load-image

write/binary %tmp.jpg read/binary http://www.rebol.net/photos/carl3.jpg
view layout [ image %tmp.jpg button "close" [unview/all]]
delete %tmp.jpg
Anton:
31-Oct-2010
Oldes shows that you can't just "load-image/clear", you must "load-image/clear 
imgfile", which loads a new image after clearing the cache. It offers 
no way to separate the two functionalities. Annoying, isn't it?


O  Use  clear second second :load-image , as you are, but I suggest 
doing this straight after the loading, eg.

 layout [ image %tmp.jpg  do [clear second second :load-image] ... 
 ]

O  Patch or replace LOAD-IMAGE  eg. so its IMAGE-FILE argument can 
also be NONE!

O  Patch the IMAGE style by changing the FILE function in the MULTI 
object:
	print mold get in svv/vid-styles/image/multi 'file
    so it doesn't use LOAD-IMAGE.
[ ]  Submit this deficiency to curecode.

Or  
>> view layout [image (load %bay.jpg)]
>> mold second second :load-image
== "[]"
Brock:
31-Oct-2010
am I stating something obvious when I say check the source for load-image?
Brock:
31-Oct-2010
>> source load-image
load-image: func [
    "Load an image through an in-memory image cache."
    image-file [file! url!] "Local file or remote URL"
    /update "Force update from source site"
    /clear "Purge the entire cache"
    /local image image-cache
][
    image-cache: []
    if clear [system/words/clear image-cache recycle]
    if any [update not image: select image-cache image-file] [

        if all [update image] [remove/part find image-cache image-file 2]
        repend image-cache [
            image-file
            image: either file? image-file [load image-file] [

                either update [load-thru/binary/update image-file] [load-thru/binary 
                image-file]
            ]
        ]
    ]
    image
]
Oldes:
1-Nov-2010
I was checking the source of course, without it I would not come 
with code like:
	clear second second :load-image


But it was not for the first time when I had the situation with the 
unexpected image. Of course, to use :
	layout compose [image (load %image.jpg)]

is a solution as well. I just have to remember it not be confused 
again with code:
	layout [image %image.jpg]


The problem is, that normal user who want's to just display simple 
view layout does not know that there is the function load-image.
Cyphre:
1-Nov-2010
another rokaround is:
load-image/clear http://
or load-image/clear to-url none
etc.
Endo:
5-Jul-2011
Can someone confirm this issue: secure allow permits all access, 
but library access still pops up security window.

>> secure allow

== [net allow library allow shell allow registry allow envr allow 
file allow]

>> dll: load/library %REb-Excel.dll
** Access Error: REBOL - Security Violation
** Near: dll: load/library %REb-Excel.dll
Gabriele:
6-Jul-2011
I've never seen this either. But all my scripts that use load/library 
are started with -s... (or encapped)
Group: !REBOL3-OLD1 ... [web-public]
Rod:
2-Jan-2008
Thanks Maarten, very glad someone is taking that load off Carl.  
I can only hope it means a more steady stream of information will 
be available as well a public alpha (at some point).  I was going 
to ask for an update since the latest blog entries are more than 
a month old now.
BrianH:
15-Jul-2008
That's why X/OSX/Vista has been trying to centralize the OpenGL/DirectX 
rendering, to share the load.
BrianH:
25-Jul-2008
For that matter, I recall that there was some talk of changing the 
SAVE and LOAD functions completely. It is an unresolved design issue, 
unless Carl's current work includes string encoding and decoding 
as well.
btiffin:
19-Aug-2008
Re BDB;  Found this on the cuil.com main page of a rebol search, 
by fluke of timing more than anything.

http://www.cs.unm.edu/%7Ewhip/   Jeff Kreis' libdb interface.  Works 
great with 2.7.6 and the freed load/library.  I just had to tweak 
Jeff's libdb.c to use my setup and to get around that pesky incompatibilty 
that I blame on Gabriele now  :)
Dockimbel:
4-Sep-2008
So, do you mean that with R3 to access a DLL I have to build (in 
REBOL and/or C) a plugin, then dynamically load the plugin and then 
the plugin will load the DLL ?
Pekr:
5-Sep-2008
Brian - it is not correct that no work was done. Carl told me few 
months ago, that plugins are some 80-90% done. They have forma API, 
they are just disabled. The plugin simply exports some info for REBOL 
to load and bind or something like that ...
shadwolf:
5-Sep-2008
if RTmakesavailable  a signature bank for trusted pluging and when 
rebol runs a load-plug command this function send the name of the 
plug +  actual signature and compare it to what is stored in RT's 
bank but this mean offline using of plugs will be impossible
shadwolf:
5-Sep-2008
Hum I proposed long along when I was complaining about load/dll unfriendly 
shape to make a ported library repository wich you can find the standard 
libraries and the bridge to use them . the repository could be acknoleged 
by RT who will grant the lib is tested and safe download it and distribute 
is widely
shadwolf:
5-Sep-2008
now it depends of how do we considere the rebol sharings. what about 
those who want to build custom "plugins" based on official other 
libs but with only in it what htey need and not the whole thing (like 
SDK allows you to customise the VMrebol version you are going to 
share with your application...) Like rebolinforms the user when a 
rebol script is accessing external data it will be first  an information 
about the fact the script is about to load a plugin   and ask for 
user to continue or cancel. And if the user says yes then the answer 
is stored by rebol (in registry for example) so in next run the user 
is not bothered anymore. If the user is plugin to internet then rebol 
could check on the offical repository if the plug is safe or not 
this will give the user  an ensurance that the plug is safe.
shadwolf:
5-Sep-2008
once again load/DLL  exists for a long time but we can't says that's 
a widely used feature. Most because doing a bridge .R is painfull
Henrik:
14-Oct-2008
REBOL [
	Title: "REBOL 3 GUI - Development Module Loader"
]

files: [
	%x-funcs.r
	%g-defs.r
	%g-debug.r
	%g-funcs.r
	%g-styles.r
	%g-faces.r
	%g-panels.r
	%g-events.r
	%g-text.r
	%g-effects.r

	%s-fonts.r

	%s-panel.r
	%s-button.r
	%s-bars.r
	%s-text.r
	%s-image.r
	%s-lists.r
]

code: collect [foreach file files [keep load file]]

len-kb?: func [s] [round/to divide length? s 1024 .1]

src: mold/flat code
gui-cmp: compress src
gui-size: len-kb? gui-cmp 

print ["GUI Size:" gui-size "KB /" len-kb? src "KB"]

do code
Henrik:
22-Oct-2008
Code example:

do %load-gui.r

files: read %*.r

view/options [
	tight [
		text-list files do [set-face ca read-string pick files value]
		scroller
	]
	ca: code-area
][
	title: "REBOL Scripts"
	columns: 0
]

Produces

http://rebol.hmkdesign.dk/files/r3/gui/036.png
Henrik:
26-Oct-2008
>> source make-panel
make-panel: make function! [[
    {Create a panel from layout dialect block and options block.}
    style [word! none!]
    content [block! none!] "Contents of the panel"

    options [object! block! map! none!] "Options of the panel" /local 
    options face
][
    if content [
        unless options [options: copy []]
        extend options 'content content
    ]
    face: make-face style options
    init-panel face
    bind-faces face
    do-style-all face 'on-init none
    do-triggers face 'load
    face
]]
Pekr:
7-Dec-2008
Henrik - I can tell you one thing, which I smiled to :-) Carl is 
imo worrying, that releasing in current state could put us in situation, 
where we would not be able to handle the load. And I know, that you 
mostly back up everything Carl says ;-), but then I pointed him to 
R3-alpha release wiki page. He told me he forgot about that site, 
and that he forgot we already did something like that. So please 
- give me an answer - first public alpha was released in last january, 
and NOTHING bad happened. It was released only because of my constant 
push and ramblings. So - why should devs collapse under some heavy 
load now, one year later? Nothing like that will happen.
Pekr:
25-Dec-2008
I thought we could release too. Good thing is, that Carl thinks, 
that we need to get many more developers on-board, and so he is doing 
some preparation work to handle the load.
Sunanda:
5-Jan-2009
No load/library in the current (ie jan-2008) public alpha.
Not sure if it is in later versions.
Pekr:
5-Jan-2009
Sunanda - all Carl's energy is spent on prepraration for the next 
alpha release, the public one. I think it is wise to have infrastructure 
ready first, to handle the load it might cause.
Sunanda:
5-Jan-2009
Maxim -- load has to some extent been replaced by transcode.
So lack of /library may mean the functionality is elsewhere.
The same is true with load/header.
Maxim:
5-Jan-2009
I always tought that the load/save refinements for library and image 
formats was pretty strange.
Maxim:
5-Jan-2009
also, for lib usage a GC-independant alloc() dealloc() equivalent 
would be VERY usefull.  something we can manually free, in order 
to work with large dataset we really don't want the GC to grab.  
for example, using image magic, I can work with 10GB image files. 
 composing 100 of those images into another.  I can't let rebol's 
GC play around with such specific needs... this is just one example, 
but there are others.


sometimes handling stuff manually is easier than hoping an automatic 
system will do so properly.  in R2, images are never freed, for example, 
so for a task which rebol would be the ultimate image manipulator, 
I can't use it cause the third image I load from disk craps out rebol, 
since it grows beyond 1.5GB of RAM.
Maxim:
5-Jan-2009
yess I did, but in this case, the goal is to do interactive AGG manipulation 
of one image at a time and stamp it on a layered composition.  by 
the time I load the third image (from a digital camera at 7.1 MPixel), 
rebol crashes  :-(
Maxim:
5-Jan-2009
(well maybe more than 7.1MPixel. but anyways... the fact that REBOL's 
memory footprint grows everytime I do load on a .png... and never 
shrinks... means it will eventually crash, whatever I do  :-/
Henrik:
5-Jan-2009
Maxim, does it also happen if you load it into a pre-allocated binary 
and clear it when you're done?
Henrik:
5-Jan-2009
>> loop 10 [load http://imgtops.sourceforge.net/bakeoff/o-png24.png
probe stats]
8182845
9736970
7443459
8997056
7443107
8996528
7442755
8997056
7443811
9001104

So no dangers there at least.
Pekr:
7-Jan-2009
Still work in progress, but good sign of things happening ... so 
hopefully, in one month, there will be load of devs cooperating on 
R3 development ...
BrianH:
7-Jan-2009
Just discovered today in R2: LOAD/header has two errors.

- LOAD/header of a directory should fail with a syntax error, but 
doesn't.

- LOAD/header "rebol []" or the script equivalent should return the 
header object in a block, but instead returns it straight.

The /header option is being checked at a lower priority than it should 
be. Fixed in R3 today though.
BrianH:
7-Jan-2009
LOAD is a mezzanine in R3. You have no idea how cool this is :)
btiffin:
7-Jan-2009
Re; LOAD; well yeah ... TRANSCODE can be used to support junk! now. 
 ;)  You'll love it Brian, really.  You can have your grandma asking 
you questions about deep deep PARSE problems as she dances around 
the console analyzing her grocery list, while you point out that 
the total is actually wrong due to a lexical problem with some of 
the money! values.  Then, 4 months later, she'll teach you something 
that her new perspective and point of view made possible as she unveils 
the world's greatest home management software ... like evv-a.   :)
BrianH:
7-Jan-2009
Oh, I love TRANSCODE already, but it is not finished, so I can't 
yet use it to implement R3's LOAD/next.
BrianH:
7-Jan-2009
Write it yourself. Use a user-defined junk! string type, and your 
own LOAD to work with it. It's easy (for experts). I've rewritten 
LOAD several times in the last week, twice today :)
BrianH:
7-Jan-2009
You don't want LOAD to be relaxed by default - that would be a debugging 
nightmare. I think that an optional user-provided fallback function 
would be a better choice. I'll look into retrofitting LOAD with one 
once we get LOAD/next working.
Maxim:
7-Jan-2009
hummm  seems to me like the recycle word becomes obscure .... hehehe 
load junk!  or recycle data   ;-)
Maxim:
7-Jan-2009
parse is intimidating for the majority of rebolers... 

supporting the unknown! data makes it easier to just :

data: load/allow %somedata
foreach item data [
	switch type?/word item [
		...
	]
]


This makes handling external data, which is often 90% compatible, 
sooo simple.
Graham:
7-Jan-2009
but my load dialect compensated
Steeve:
7-Jan-2009
just a thing, as far i know, "comma" are used no where in rebol values 
(except in replacement of points) why are they not handled by load 
as a separator like tab or blank
BrianH:
7-Jan-2009
You mean that programming language syntax and data syntax don't match 
exactly. LOAD is for REBOL syntax, and we want those errors for REBOL 
syntax. Those thrown errors help you clean up your bugs.
Maxim:
7-Jan-2009
but load can also understand just about all human readable ascii 
data ALSO.
Maxim:
7-Jan-2009
then, maybe, although it does the same thing AS load, it wouldn't 
be used by the interpreter, and would explicitely allow the interpreter 
to use the loading functionality which already understands about 
95% of human readable ascii text as it is.
Maxim:
7-Jan-2009
really brian, I can't recall how many times I've had ascii files 
from sources which I could almost just load as-is.  and when the 
extra syntax, was just useless decoration, which can be ignored.
Maxim:
7-Jan-2009
brian, I think everyone is just talking about a standardized, way 
to load human-readable data.  we know its not REBOL data.
BrianH:
7-Jan-2009
Maxim, I agree with you! I just remember that LOAD is for loading 
REBOL data, not human data. We should have standard functions for 
parsing human data, localized. But there are real disadvantages to 
making LOAD that function.
BrianH:
7-Jan-2009
Here's the current source for LOAD:

load: func [
	{Loads a file, URL, or string.}
	source [file! url! string! any-block! binary!]

 /header  {Includes REBOL header object if present. Preempts /all.}

;	/next    {Load the next value only. Return block with value and 
new position.}

;	/library {Force file to be a dynamic library. (Command version)}
;	/markup  {Convert HTML and XML to a block of tags and strings.}
	/all     {Load all values. Does not evaluate REBOL header.}
	/unbound {Do not bind the block.}
	/local data tmp
][
	; Note: Avoid use of ALL func, because of /all option
	if any-block? :source [return :source]

	data: case [
		string? source [to-binary source]
		binary? source [source]
		; Check for special media load cases: (temporary code)
		find [%.jpg %.jpeg %.jpe] suffix? source [
			return load-jpeg read/binary source
		]

  url? source [read source] ; can this possibly return not binary! 
  ?
		file? source [read source] ; binary! or block of file!
	]

 ; At this point, data is binary!, a block of file!, or something 
 weird.

	if binary? :data [
		unless find [0 8] tmp: utf? data [
			cause-error 'script 'no-decode ajoin ['UTF tmp]
		]

		; Only load script data:
		if any [header not all] [ ; Note: refinement /all
			if tmp: script? data [data: tmp]
		]
	]

	unless block? :data [data: to block! :data] ; reduce overhead

 ; data is a block! here, unless something really weird is going on
	tmp: none
	
	; Is there a REBOL script header:
	if any [header not all] [ ; /header preempts /all
		tmp: unless any [

   ;not any [file? source url? source] ; removed: hdr in string is same
			unset? first data ; because <> doesn't work with unset!
			'rebol <> first data
			not block? second data
		][ ; Process header:
			attempt [construct/with second data system/standard/script]
		]
		; tmp is header object or none here
		case [
			tmp [
				remove data
				either header [change data tmp][remove data]
				tmp: tmp/type = 'module ; tmp true if module
			]
			header [cause-error 'syntax 'no-header data]
		]
	]
	; tmp is true if module, false or none if not

 ; data is a block!, with possible header object in first position

	; Bind to current global context if not a module:
	unless any [
		unbound
		tmp ; not a module
	][
		bind/new data system/contexts/current
	]

 ; data is a block! here, unless something really weird is going on

	; If appropriate and possible, return singular data value:
	unless any [ ; avoid use of ALL
		all
		header ; This fixes a design flaw in R2's LOAD
		;not block? :data ; can this ever happen?
		empty? data ; R2 compatibility
		not tail? next data
	][data: first data]
	; If /all or /header, data is a block here

	:data
]
btiffin:
7-Jan-2009
Adding foreign! doesn't really change LOAD does it?  It changes the 
native  make  phase  no?
Chris:
7-Jan-2009
Quick 'n' dirty 'load-junk (cvts: for R2; junk! is string!; blocks 
mess things up): http://www.ross-gill.com/r/load-junk.r
BrianH:
7-Jan-2009
Look how complex LOAD is already. That is why it is now mezzanine: 
The complexity is better handled by REBOL code.
Steeve:
7-Jan-2009
hum... Brian, switch is not faster than case in load ?
BrianH:
7-Jan-2009
Adding a lexical foreign! means you add the overhead of checking 
for valid syntax to *all* REBOL code, not just LOAD. It removes your 
ability to trust that what comes out of LOAD is valid. That is a 
huge overhead to all REBOL code, and would be the source of most 
REBOL bugs in the future. It is a horrible thing to do to the community.
btiffin:
7-Jan-2009
No *you* want syntax errors.  I want to load %kingjames.txt  and 
call sort.   ;)
btiffin:
7-Jan-2009
Can't you see how cool it would be to let a person   load %textfile.txt 
and do analysis?  With foreign! sitting there ready to trigger if 
evaluated?
BrianH:
7-Jan-2009
How about letting them do
    load/else %textfile.txt 'string
BrianH:
8-Jan-2009
I was working. I just fixed LOAD, DO and CLEAN-PATH, and they will 
be incorporated tomorrow. The current build has built-in functions 
to get to DocBase, RebDev and CureCode. We're really close to release.
BrianH:
8-Jan-2009
The LOAD function above is likely to be the release version. The 
commented out options aren't done yet :(
Pekr:
8-Jan-2009
am I alone thinking, that ability to load junk by default is utter 
nonsense?
btiffin:
8-Jan-2009
Pekr;  I still don't get the counter argument.  What is the scary 
deal with  load "1 2 3 abc $10,000,000.00" returning a block of [integer! 
integer! integer! word! foreign!]  instead of a syntax error?  Why 
fear this?
Tomc:
8-Jan-2009
load/anyway
Tomc:
8-Jan-2009
load/whatever
btiffin:
8-Jan-2009
Sure, and it'll still be foreign!   so would 1212.12.1212.12121212.121212. 
  S'okay   still just foreign!   as would  $$$$12@@!@!@#3   just 
foreign!   instead of a syntax error during the make phase.

And tomc, yes,  unrefined load  is a poor choice of example   load/somerefinement 
 would be far better, but I still don't see the fear of foreign!
btiffin:
8-Jan-2009
well no   load/somerefine "$123,45"   would / should  still parse 
as   [money!] with $123.45 as the value, s'okay.
btiffin:
8-Jan-2009
Gain?    load/whatever %kingjames.txt    now I can sort, do counts, 
analyze text files.   If I blindly do this block foreign! would throw 
error on eval, or use in math etc...
Pekr:
8-Jan-2009
OK, I don't mind either way. Talk to gurus, as i can't see the consequences. 
If it does not slow rebol code parser, then it is OK. And as BrianH 
said - 'load is a mezzanine. It can be patched. I think that adding 
one refinement would not hurt us ...
Maxim:
8-Jan-2009
rebol's litteral value handling within load is SOOOO fast. having 
to build to build your own parser to replicate what load does is 
NOT simple.  we always talk about simplicity, how beautifull it is...
Sunanda:
8-Jan-2009
We need something like load/markup.....That splits a string into 
<tags> and "strings". The strings can then be processed separately 
from the tags.

So load/datatypes -- split a string into recognisable REBOL datatypes, 
and other! (aka Junk!)
Maxim:
8-Jan-2009
adding this basic functionality in the language would allow us to 
use it directly in load and then just have a simple mechanism where 
either a new word, like 'ASSIMILATE is used and indentifies foreign 
data with a  !foreign!   label.
BrianH:
8-Jan-2009
The only safe place to deal with this foreign data is inside LOAD 
itself, before it returns (with user-provided code though).
Steeve:
9-Jan-2009
hmmm...[spoiler]

in R3, seems that to send and receive requests to an html server, 
it's really as simple as.

data: load write http://www.rebol.net/cgi.rto-binary "my request"
Maxim:
9-Jan-2009
For example, I'd add quite a few protects in my user.r to ensure, 
no application tries to replace how LOAD and SAVE function...
DideC:
21-Jan-2009
Exactly. It must load the block, so create the words. Then it can 
do it.
DideC:
21-Jan-2009
REBOL/View 2.7.6.3.1 14-Mar-2008
Copyright 2000-2008 REBOL Technologies.  All rights reserved.
REBOL is a trademark of REBOL Technologies. WWW.REBOL.COM
>> load [blah: 1]
== [blah: 1]
>> find first system/words 'blah
== [blah]
>> blah
** Script Error: blah has no value
** Where: halt-view
** Near: blah
Pekr:
21-Jan-2009
some few weeks ago I posted here xy links about new ports, read vs 
load etc blogs, which sum those issues up ...
Steeve:
21-Jan-2009
No Henrik, the data are stored like rebol values (not in binary or 
other obfuscated format).

It means that you can load the data files (with load %data) and you 
will load that whole block into memory.
Henrik:
21-Jan-2009
>> source chat
chat: make function! [[
    "Open REBOL DevBase forum/BBS." /local err
][
    print "Fetching chat..."
    if error? err: try [do http://www.rebol.com/r3/chat.rnone] [

        either err/id = 'protocol [print "Cannot load chat from web."] [do 
        err]
    ]
    exit
]]
BrianH:
21-Jan-2009
Weird. Do you use a different LOAD than the one in R3 by default, 
or a different SCRIPT?
Dockimbel:
22-Jan-2009
From what I understood, RIF would have several advantages compared 
to a mezz-level approach :

- fast indexed storage engine in C (probably btree indexes as sqlite 
storage layer was considered for RIF)

- no LOAD/MOLD overhead (direct reading/writing of values in memory)
DideC:
23-Jan-2009
By the way, as Brian say, RebDev can stay as it is for a moment. 
It's simple Rebol data, so it could be easily transform to whatever 
new storage mechanism is needed when the time will require.

And, I don't think the client need to load the whole msgs db as most 
of the time (99.9%) user just read the lasts msgs. So It can be changed 
to cache last 10000 msgs and will only deal with the full db if user 
ask it to do (ie : search).


And to finnish, 24MB is not much for 100'000 msgs. I would not bother 
until it reach 200MB (It's what FF3 take after half a day of surfing) 
so I have 800'000 msgs left :-)
[unknown: 5]:
26-Jan-2009
load-gui doesn't work either.
1401 / 232912345...1314[15] 1617...2021222324