r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[Core] Discuss core issues

Gregg
20-Sep-2007
[8739]
AS/400 isn't on the current short list of OSs that are kept up to 
date. It looks like the old download page has moved as well, so I 
don't know what the most recent version is.
PhilB
21-Sep-2007
[8740]
Partrick, I work on AS400's and have never seen any rebol release 
for it. The Core release for the platform was always marked as 'pending'.
PatrickP61
24-Sep-2007
[8741]
Hi Phil.  I guess it depends on what OS the AS/400 is running.  I 
have seen some references to AIX  or Linix, which Rebol does have 
a version for, although it is probably an old version.  http://www.rebol.com/platforms-core.html
james_nak
1-Oct-2007
[8742]
I was loading a file, one which contained a block of make object! 
and the other with a single make object!  I noticed that I could 
do a  "reduce" on the block and get the expected results of having 
a block of objects but I had to use "do" on the single object instead 
of reduce. What is the difference between do and reduce?
btiffin
2-Oct-2007
[8743]
It's not directly related, but Ladislav has some pretty good articles 
on this.

http://en.wikibooks.org/wiki/REBOL_Programming/Advanced/Interpreter
and http://www.fm.tul.cz/~ladislav/rebol

The core manual kind of explains things at http://rebol.com/docs/core23/rebolcore-4.html#section-4.4
Gregg
2-Oct-2007
[8744]
DO returns the last value in the block it DOes, but both evaluate, 
so I'm not sure what the exact data looks like that you're loading, 
or how you're loading it. LOAD can behave differently, based on file 
contents; returning a block or not.
james_nak
2-Oct-2007
[8745]
Thank you guys, that explains some of the behavior right off the 
bat. It was just one of those odd things to me that pops up once 
in a while.
btiffin
2-Oct-2007
[8746]
REBOL?  Odd?  :)  It's one of the few languages I've been exposed 
to where the deeper issues seep in over time and by osmosis; and 
can't really be hastened by intense study (at least for me). Study 
and research do help...it's just that REBOL comes with seemingly 
random and totally cool eureka moments.  Skill with the Forth block 
editor and anything Icon are other time and osmosis environments; 
in my experience.  Most computing is almost boring in comparison.
james_nak
2-Oct-2007
[8747]
:  )
Oldes
3-Oct-2007
[8748]
Is there any simple way hot to reduce into flat block?
So I would not have to use something like:

tmp: reduce [1 2]
either true [append tmp [1 2 3]] [1] ;one or more values
append tmp [4 5]
tmp

I would like to have something like:

reduce/flat [1 2 either true [[1 2 3]][1] 4 5]
with result:
[1 2 1 2 3 4 5] and not [1 2 [1 2 3] 4 5] as with simple reduce
Ladislav
3-Oct-2007
[8749]
any reason why compose is not sufficient for the job? - then you 
may try my Build function
Oldes
3-Oct-2007
[8750]
Ah.. I can use compose... :) I don't know, why I still prefere reduce 
against compose
Ladislav
3-Oct-2007
[8751x2]
build example:

    build/with [1 2 either true [[1 2 3]][1] 4 5] [either: get in system/words 
    'either]
another option how to do it using build:
    build [1 2 ins either true [[1 2 3]][1] 4 5]
[unknown: 5]
6-Oct-2007
[8753]
how is open/custom used?
DanielSz
10-Oct-2007
[8754]
Hi there, are there any rebol wrappers or bindings for LDAP stuff? 
Apart from the fact that the ldif format is already very close to 
native rebol syntax, it would be a neat thing to have.
Pekr
10-Oct-2007
[8755x2]
not sure. IIRC Softinnov.org has some menthion of LDAP, but IIRC 
it was not complete. You would have to ask DocKimbel. Don't remember 
if anyone else worked on it.
If LDAP is a complex thing, it would be maybe to create some wrapper 
to some existing open-source library, if there is any ....
DanielSz
10-Oct-2007
[8757x3]
Thanks, Pekr, DocKimbel would be indeed the person to ask because 
of his work on the mySQL drivers. After all, a directory (on which 
LDAP focuses)  is nothing but a specialized database. I'm not sure 
what my needs are because I just started playing with it. Maybe Rebol 
can assist in the conversion of external sources (CSV for example) 
to ldif format and possibly populating the directory automatically.
Softinnov says the following on its web site:
This project aims to propose a standard LDAP support for REBOL/Core 
by implementing the LDAP protocol using REBOL schemes (ldap://), 
so standard functions like open, insert, find, remove,... can be 
used directly on the port.


The implementation is an on-going work and has been suspended for 
some months now (due to higher priority projects). The current alpha 
supports the following features : 
BER encoding/decoding logic.
REBOL dialect for BER structures representation.
Basic LDAP v3 protocol.
Searching for record using a high level dialect
Port handler implemented.
What's not currently implemented: 
Clean and reliable low-level I/O.
Full v2/v3 protocol support.
Adding, Modifying, Deleting data.
Authentication.

The current work has been done following the classic REBOL port! 
communication model, that means : synchronous communications. There's 
great chances that I choose to port the current work under Uniserve 
to benefit from a full async model and not push the sync version 
to the end...
Henrik
11-Oct-2007
[8760x9]
I'm stuck with a BIND problem. What may cause a value that is a string 
to become NONE when it's bound to a block? It's only this one value 
out of several that I have problems with. There are other strings 
bound to the block that work correctly. I have no idea what's going 
on. Suggestions?
the bind is in a foreach loop that very roughly looks like so:

a: [c d e]

f: [stuff (c)  more stuff (d)]

foreach :a b [
...stuff
  compose/deep bind f 'c
...stuff
]


For some reason 'c in the bound block is NONE. I tried binding to 
'd, copy/deep the block, but nothing.
If I probe 'c just before the bind, it has the correct value
if I change 'c to some random word, that doesn't help either.
I think I'm figuring it out.... nasty bind problem
DO MOLDing a block should shake off all bindings right? it doesn't 
seem to happen here.
Very interesting stuff... but hard to explain. I've not solved the 
problem, but my bindings are apparently a mess.
YEAH!
sorry about that, but this problem has bugged me for several days. 
Finally nailed it. I figured it out: If you have a function with 
local words, FOREACH creates its own context for the words that it 
uses. I had 'value both as a local word and as a word inside the 
FOREACH, hence the confusion.
[unknown: 5]
11-Oct-2007
[8769]
I have had problems before with using 'value.  I try to avoid it 
now - maybe it was a foreach function - I don't recall.
Henrik
15-Oct-2007
[8770]
is there a simple way of converting a block of true/false values 
into bits in a binary?
Gregg
15-Oct-2007
[8771]
Use INSERT for the true values, and remember that bitsets have a 
zero base.

>> bs: make bitset! []
== make bitset! #{
0000000000000000000000000000000000000000000000000000000000000000
}
>> blk: [true false true false true false true]
== [true false true false true false true]
>> repeat i length? blk [if blk/:i [insert bs i - 1]]
== make bitset! #{
7F00000000000000000000000000000000000000000000000000000000000000
}
Henrik
15-Oct-2007
[8772x3]
I see. :-/
hmm.. can't convert that to an integer.
to-integer trim to-binary bs

seems to work.
Terry
16-Oct-2007
[8775]
a: [11 22 33 44 55 66 77 88 99]

b: 44
foreach [ s p v] a [ if s = b [ remove s p v ???]
sqlab
16-Oct-2007
[8776]
while [pick set [s p v] a 1] [if s = b  [remove/part a 3  a: skip 
a -3] a: skip a 3]
btiffin
16-Oct-2007
[8777x2]
Another opinion piece;
While developing I've taken to starting each script with


;; if a symbol exists and is true, when will evaluate the block of 
code
;; when/not will evaluate the code if the symbol is not set
when: func ['condition [word!] code [block!] /not] [
    either not [
        unless value? condition code
    ][
        if all [value? condition  get condition] code
    ]
]

This allows for

; See if testing requested as script argument or it could be set 
by a caller
when/not testing [

    if all [system/script/args  find system/script/args "/test"] [
        testing: on
    ]
]
; If requested, try loading the test facility or stub it.
when testing [
    absent test [
        if error? try [do %../Test/test.r] [
            test: func ["test stub" drop [block!]] []
        ]
    ]
]


I had been using  given  and  absent (for when/not).  Anyone got 
a better way of handling conditional load sequences and command line 
argument passing that supports development cycles while not having 
to change the code for testing, autodocing  and production rollout?
Oops, an absent snuck in there from and older (untested...sad) cut'n'paste
   when testing [  when/not test ...
Terry
16-Oct-2007
[8779]
Thanks sq
Ladislav
17-Oct-2007
[8780]
foreach [ s p v] a [ if s = b [ remove s p v ???]
 - this is the Rebol way:
remove-each [s p v] a [s = b]
Terry
17-Oct-2007
[8781]
Cool, was wondering how remove-each worked, thanks Ladislav.
Sorry sq.
sqlab
17-Oct-2007
[8782]
I learned something too
Terry
21-Oct-2007
[8783x2]
With inline javascript in HTML, it's not uncommon to find a brace, 
apostrophe and a double quote in a single line  ie:


<a href="#"  onclick="$('test').function(){'some', 'options';}">Hrmm</a>

So, what's the best method for prepping this for output?

output: {}   ... then escape the all braces?
Braces are ok, if there's always a pair.. otherwise i guess the best 
method is braces, and escape any in the string with ^{   or ^}
Graham
21-Oct-2007
[8785x2]
it gets really messy though
what we need is some other way to enclose literal strings that are 
full of " ' and {}
Terry
21-Oct-2007
[8787]
aye
Gregg
21-Oct-2007
[8788]
I would avoid the "some other way", because you're always going to 
hit the issue with some char. At least escapes are consistent and 
easy to reason about. Of course, that doesn't help when they aren't 
used properly.