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

World: r3wp

[Core] Discuss core issues

BrianW
14-Mar-2005
[719]
beginning of the second block
Ammon
14-Mar-2005
[720x3]
Ah, so it is. ;~>
Hm...  I end up with...

** Script Error: assert has no value
** Near: assert [ed/summary == "1 run, 1 failed"]
So 'ed must be defined somewhere else as well?  Have you tried using 
another word?
BrianW
14-Mar-2005
[723x3]
Let me make the whole script available. I was hoping it was a very 
simple logic error in those lines.
http://coolnamehere.com/rebol/xunit.r
The "probe result" line at the end is usually "print probe disarm 
result", but I set it back while trying to poke at this issue.
Ammon
14-Mar-2005
[726]
Ahah!
BrianW
14-Mar-2005
[727]
aha? Yes, yes?
Ammon
14-Mar-2005
[728]
A favorite subject of mine. ;-)
BrianW
14-Mar-2005
[729]
heh.
Ammon
14-Mar-2005
[730]
in 'test-case-test, you are redefining 'test-result as a function, 
not globaly so you aren't actually changing the definition but adding 
a new one to the current context.
BrianW
14-Mar-2005
[731]
oh jeez. Thanks :-)
Ammon
14-Mar-2005
[732]
so when you 'make 'test-result you are making a function not the 
object that you thought that you were making...
BrianW
14-Mar-2005
[733x2]
Is there a flag I can set to warn when something is being redefined?
I changed function 'test-result to function 'test-result-summary 
and everything is golden again.
Ammon
14-Mar-2005
[735x3]
You can keep your current set up with the redefined 'test-result 
but you will need to run 'compose on the spec block being passed 
to 'test-case-test and enclose 'test-result in a paren
Not for something like this, particularly since you aren't actually 
redefining anything! ;~>
You're creating a NEW definition in a NEW context.
BrianW
14-Mar-2005
[738x2]
so ...

test-case-test: make test-case compose([ ... ])
Did I understand that correctly?
Ammon
14-Mar-2005
[740x2]
almost
'compose evaluates any parens in the block passed to it.  If you 
are passing 'compose a block containing blocks that contain values 
you would like composed then you need to use the /deep refinement 
of compose
BrianW
14-Mar-2005
[742]
ow.
Ammon
14-Mar-2005
[743]
; (i.e. 
test-case-test: make test-case compose/deep [
    ...
    test-result-formating: func [/local ed][
        ed: make (test-result)
        ...
    ]
]
BrianW
14-Mar-2005
[744x2]
I think I'll avoid 'compose for now, and leave it for when I'm done 
with the basic stuff in the test book.
but that's good to know, thanks again.
Ammon
14-Mar-2005
[746]
Np, you're welcome!
Gregg
14-Mar-2005
[747]
obj-spec: func [
    "Returns the object spec as a single line (flat) string."
    obj [object!]
    /only "no surrounding brackets"
    /mold "Multi-line MOLDed format"
    /local res
][
    res: copy find/tail system/words/mold obj "make object! "
    if not mold [trim/lines res]
    if only [res: trim/auto next head remove back tail next res]
    res
]

remove-words: func [

    "Returns a copy of the object with the specified words removed."
    object [object!]
    words  [word! block!] "The word, or words, to remove"
    /local spec
][
    spec: load obj-spec object
    foreach word compose [(words)] [
        remove/part find spec to set-word! word 2
    ]
    make object! spec
]
Micha
15-Mar-2005
[748]
how to count difference time
 x:  now/precise
== 15-Mar-2005/11:01:58.139+1:00
 y: now/precise
== 15-Mar-2005/11:02:38.733+1:00

x - y  =
Graham
15-Mar-2005
[749]
help difference
Micha
15-Mar-2005
[750]
subtract
Graham
15-Mar-2005
[751]
difference now/precise now/precise
Micha
15-Mar-2005
[752x3]
block: [ "a:" "string1" "b:" "string2"    ]

Fremowe: func [x y][return remove remove find x  y ]

Fremowe block "a:"
not remove a ?
what this function does not act ?
Pekr
15-Mar-2005
[755x2]
1) You don't have to use return word ...., function does return the 
last point of its evaluation
and besides that, it works here ...
DideC
16-Mar-2005
[757]
He guys, I need you !!!
Volker
16-Mar-2005
[758]
ping?
DideC
16-Mar-2005
[759]
I want to get in a Rebol script what I print on a standard windows 
printer.

I use Redmon (part of ghostview) to redirect what the printer get 
to my rebol script
RedMon : http://www.cs.wisc.edu/~ghost/redmon/index.htm
I'm under Windows.

How can I get data from the standard input ?

I have tried "copy system/standard/input" and also "input", but get 
nothing !!
plis help ;-)
Volker
16-Mar-2005
[760x4]
have you tried -w? that uses dos-window as console AFAIK.
or use a temporary file?
Ah, this looks like a cgi-stype call. i would try --cgi then. it 
should do this "call and get data from stdin".
cgi-stype -> cgi-style
Micha
16-Mar-2005
[764x2]
;serwer proxy


p: make port! tcp://:80

p/awake: func [ port /local  data conn targed cmd partner url 
] [



conn: first port
wait conn
data: to-string copy conn

replace/all data "^M" ""
source data

targed: copy/part data find data "HTTP/1.1"
data: find/tail data "^/"
print targed

cmd: parse targed none

url:  decode-url cmd/2 

if not url/path  [url/path: "" ]

if not url/target  [url/target: ""]

partner: open/no-wait to-url rejoin [ "tcp://" url/host ":80" ]




insert partner rejoin [ cmd/1" /" url/path url/target " HTTP/1.1^/" 
 data]

wait partner

tmp: copy partner




close partner



insert conn tmp



close conn 

]


append system/ports/wait-list p


open/binary/no-wait p
 wait []


halt
what this server not act ?
Anton
16-Mar-2005
[766x2]
what this server not act ?
  -->  "why does this server not work ?"
print [rebol/product rebol/version]
Micha
16-Mar-2005
[768]
View 1.2.55.3.1