[REBOL] Re: No-wait

2004-02-23 Thread Volker Nitsch

Am Sonntag, 22. Februar 2004 20:49 schrieben Sie:
 What is the purpose of no-wait.  Doesn't seem work for me.  Isn't no wait
 supposed to return immediately.

 For example:

 Shouldn't a forever loop that has the following code always be printing 
 instead of only once the port has received data?

 port: open/direct/no-wait tcp://:7000
 x: 0
 forever [
 print x + 1
 x: x + 1
 data: first wait port
 ]

 I would like to see it continuously printing the value of x instead of only
 after it receives data on the port.   So what does no-wait accomplish?

return what is currently in the buffer.
You want to use [ wait [port 0] ]. this returns when there is data on the 
port, or after 0 seconds. If it returns the port, there is data. so
  either port = wait [port 0][print hey data][print dumdidumdidum..]
0 is the wait-value, with [ wait [port 0:0:0.1 ] ] you would print 10* a 
second. (maybe you need to redcue, not checked)


 Paul Tretter


-Volker

-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.



[REBOL] Re: No-wait

2004-02-23 Thread Gabriele Santilli

Hi Paul,

On Monday, February 23, 2004, 4:31:01 AM, you wrote:

PT Even that still blocks.  Need a way of not waiting for the port data if
PT nothing is there.  A way to just continue processing the rest of the forever
PT loop which should be continously print the current value of x.  Maybe, I
PT need to see an example of something that works.

listen: open/no-wait tcp://:7000
listen/awake: func [port /local conn] [
print Got connection
conn: first port
; do something with conn
false
]
insert tail system/ports/wait-list listen
x: 0
forever [
print x: x + 1
wait 0.2
]

Regards,
   Gabriele.
-- 
Gabriele Santilli [EMAIL PROTECTED]  --  REBOL Programmer
Amiga Group Italia sez. L'Aquila  ---   SOON: http://www.rebol.it/

-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.



[REBOL] Re: No-wait

2004-02-23 Thread Paul Tretter

Yeah this was my current work around to use 0 as a timeout but I was a
wondering why it was needed if there was no-wait.

Paul

- Original Message - 
From: Volker Nitsch [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 23, 2004 4:51 AM
Subject: [REBOL] Re: No-wait



 Am Sonntag, 22. Februar 2004 20:49 schrieben Sie:
  What is the purpose of no-wait.  Doesn't seem work for me.  Isn't no
wait
  supposed to return immediately.
 
  For example:
 
  Shouldn't a forever loop that has the following code always be printing
  instead of only once the port has received data?
 
  port: open/direct/no-wait tcp://:7000
  x: 0
  forever [
  print x + 1
  x: x + 1
  data: first wait port
  ]
 
  I would like to see it continuously printing the value of x instead of
only
  after it receives data on the port.   So what does no-wait accomplish?
 
 return what is currently in the buffer.
 You want to use [ wait [port 0] ]. this returns when there is data on the
 port, or after 0 seconds. If it returns the port, there is data. so
   either port = wait [port 0][print hey data][print dumdidumdidum..]
 0 is the wait-value, with [ wait [port 0:0:0.1 ] ] you would print 10* a
 second. (maybe you need to redcue, not checked)

 
  Paul Tretter
 

 -Volker

 -- 
 To unsubscribe from this list, just send an email to
 [EMAIL PROTECTED] with unsubscribe as the subject.



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.577 / Virus Database: 366 - Release Date: 2/3/2004

-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.



[REBOL] Re: No-wait

2004-02-23 Thread Petr Krenzelok

Paul Tretter napsal(a):

Yeah this was my current work around to use 0 as a timeout but I was a
wondering why it was needed if there was no-wait.
  

It was not imo. Your code was imo wrong for what you wanted to achieve:

port: open/direct/no-wait tcp://:7000
x: 0

forever [
   print x + 1
   x: x + 1
   data: first wait port
]

Do you know what above code is basically doing? You opened so called 
listen socket - TCP channel assigned to you by OS. That kind of socket 
is able to accept new connections, nothing more. One there is new client 
asking for connection, it simply assigns it other type of socket, so 
called communication socket. Just look at 'probe of given port and look 
for 'local-port item - that is the port assigned to you by OS.

So basically - what did you expect your above code will do? I think I 
can tell you :-) Your 'forever loop will hang on, untill there is new 
connection coming. Just open second console and type-in:

client: open tcp://127.0.0.1:7000

and your 'x will counter will be raised by 1 - You created nothing more, 
than connection counter. For that, you choosed wrong name 'data. I would 
suggest:

console1:
-
server: open/direct/no-wait tcp://:7000
conn: first wait server

forever [
wait conn
data: copy conn
print mold data
]

console2:
-
client: open tcp://127.0.0.1:7000
data: read %user.r
forever [
   insert client data
   wait 5
]

Just copy and paste and watch your simple client/server communication 
 you can put your console code in another loop, which will be able 
to accept several connection, wait on list of clients connected and 
voila, - you've got your tcp multiplexing engine running.

Wouldn't above short description/example make it for short beginner's 
tutorial? :-) ... except the fact, that I am beginner too :-)

Cheers,
-pekr-


Paul
  


-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.



[REBOL] [ANN] [REBOL.org] Packages -- first release

2004-02-23 Thread SunandaDH

Thanks again to everyone who helped field-test some of the concepts in 
packages last week.

Packages are now live on REBOL.org --- any Library member is free to 
contribute packages if you want. Please do!


** What's a package? **

Up until now, the Script Library has only really worked for single, 
stand-alone scripts. Support for packages makes it much more flexible.

A package is a collection of files that together make up an application.  
There are up to three parts to a package:

1. the header script -- what you see if you view the script (or search the 
Library). In most cases this will be just a stub (it'll be the instructions for 
downloading the package). See:
http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=lds-demo1-pack
age.r
as an example

2. files -- files that form part of the package. The package owner will 
upload these.

3. other scripts -- other scripts from the Library that the package needs -- 
e.g. values.r or map.r. No need to upload these (they are already there). The 
owner simply has to mark them as being part of the package.


** Why contribute packages? **

1. Undying gratitude of everyone that uses your work
2. Way to distribute your work without needing to set up your own website
3. Way for non-reb users to find and use your work.
4. Useful mirror even if you have your own website


** Notes for potential package owners **

-- Logon and select contribute new package from the control panel, You'll
be stepped through the process.
-- You can add or remove files and scripts from a package at any point
-- You can share the package with other users -- useful if a couple of people
are collaborating on a development
-- The package stats page gives you useful counts of how often the files
in the package have been downloaded.


** Package downloader **

There was lots of useful, feedback last week on platform incompatibilities and
UI oddities. Thanks again for all that.

Most of the worst problems are fixed, but it'll be another week before we 
tackle the other issues.


** To find out what packages there are **

http://www.rebol.org/cgi-bin/cgiwrap/rebol/search.r?filter=type-package

View the script, and then click the Package Info link to see what files make 
up the package.


** Any problems? **

Just let me know -- either here or using the REBOL.org Feedback page.

Thanks all!

Sunanda.
-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.



[REBOL] Re: REBOL [REBOL.org] Packages announcement and competition

2004-02-23 Thread Maxim Olivier-Adlhoch

mine was microsoft saying this in the win 3.x days


We are developping a -NEW- standard


I always tought it reflected M$ view on the industry.


-MAx
---
You can either be part of the problem or part of the solution, but in the end, being 
part of the problem is much more fun.
 

 -Original Message-
 From: Ashley Trüter [mailto:[EMAIL PROTECTED]
 Sent: Saturday, February 21, 2004 6:44 PM
 To: [EMAIL PROTECTED]
 Subject: [REBOL] Re: REBOL [REBOL.org] Packages announcement and
 competition
 
 
 
  But yes, the IT world has way too many words for things that are
  almost the same.
 
 One of my favourite quotes (of unknown origin) is, The great 
 thing about 
 standards in this industry are that there are so many to choose from.
 
 
 Regards
 
   Ashley
 -- 
 To unsubscribe from this list, just send an email to
 [EMAIL PROTECTED] with unsubscribe as the subject.
 
 

-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.



[REBOL] Re: REBOL [REBOL.org] Packages announcement and competition

2004-02-23 Thread Maxim Olivier-Adlhoch

actually, I meant something WAY simpler.

just a page which you can open the rebol.org tools from, package downloader and 
librarien.
plus a few links to preset rebol.org web searches or pages of interest.

seems easy enough to do in one hour ?


-MAx
---
You can either be part of the problem or part of the solution, but in the end, being 
part of the problem is much more fun.
 

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Saturday, February 21, 2004 11:55 AM
 To: [EMAIL PROTECTED]
 Subject: [REBOL] Re: REBOL [REBOL.org] Packages announcement and
 competition
 
 
 
 A few points I'd overlooked earlier in this thread:
 
 
 MAx:
  btw, I realized that there was no more rebol.org rebsite...
  maybe you guys could just include the one or two little apps you've
  got for the rebol.org site there... really.
 
 Doing a REBOL.org rebsite is, I'm sure, going to happen one day.
 It would clearly make sense as a fourth way of accessing the
 REBOL.org content... The other three being:
 1. from a web browser
http://www.rebol.org

 2. from the downloaded desktop Library application
http://www.rebol.org/cgi-bin/cgiwrap/rebol/download-librarian.r

 3. from within any REBOL application using Library Data Services

 http://www.rebol.org/cgi-bin/cgiwrap/rebol/documentation.r?scr
 ipt=lds-local.r
 
 I'll make sure it is on the list of Things to Do, but no 
 promises on when :-)
 
 --
 
 Brett:
  For the prize, while I would be most honored and gratified to
  receive such a magnificent gift, I fear the international voyage
  this valuable item would take could be perilous and so it would
  enough for me if you could find it an alternative worthy home.
  Perhaps a local computing museum? :-)
 
 Given I got it second hand from a thrift shop, it probably lacks
 serious collectability for a museumMaybe we'll have another
 competition sometime, and I'll reoffer it as something once briefly
 owned by Brett. Now that should give it some serious kudos :-)
 
 --
 
 Robert:
  Hi, than why not name it: fileset like it is on IOS? I don't like
  word-fragmentation ;-) 
 
 Choosing the right words for things is very important, I agree.
 Apologies if I've not choose exactly the right one.
 
 But package has a venerable history in this context -- at least
 40 years, I'd guess.
 
 And fileset is not quite right either. An IOS fileset will synchronise
 both ways (you change the file, I get a new copy. I change the file,
 you get a new copy).
 
 A package is dumber than that. If I change a file in a package
 I own, the next time you download it, you will get the new copy.
 But, whatever you do to that copy -- short of emailing it to me -- I
 won't even know. The synchronisation is one way only.
 
 But yes, the IT world has way too many words for things that are
 almost the same. When I do mainframe work, I talk about data sets
 whose content lives on DASD and are updated via access methods. When
 I work in REBOL it's files on a hard disk updated via ports.
  
 Of course, a data set is not the same as a file, DASD is a wider
 concept than hard disk, and an access method is not the same 
 as a port.
 But they are close enough not to really need different words.
 
 Sunanda
 -- 
 To unsubscribe from this list, just send an email to
 [EMAIL PROTECTED] with unsubscribe as the subject.
 
 

-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.



[REBOL] Re: No-wait

2004-02-23 Thread Andreas Bolka


Monday, February 23, 2004, 4:31:01 AM, Paul wrote:

 Even that still blocks. Need a way of not waiting for the port data
 if nothing is there.

But here, only the accept (i.e. the wait on the listen port) blocks.
You can overcome this by adding a timeout:

  port: open/direct/no-wait tcp://:7000
  x: 0
  forever [
  print x + 1
  x: x + 1
  if not none? tmp: wait reduce [ port 0.02 ] [
 data: first tmp
 ; data is bound to a client port
  ]
  ]

-- 
Best regards,
 Andreas


-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.



[REBOL] [GLASS] was: [REBOL.org] Packages -- first release

2004-02-23 Thread Maxim Olivier-Adlhoch

DOH!!

this not meant for the list

 -Original Message-
 From: Maxim Olivier-Adlhoch 
 Sent: Monday, February 23, 2004 12:35 PM
 To: [EMAIL PROTECTED]
 Subject: [REBOL] Re: [ANN] [REBOL.org] Packages -- first release
 
 anyhow, I am hard at work on the ui for downloader... really, 
 it will blow your socks off.

there are some things which don't come out the same when talking to one persone than 
when talking to a group... like the above!  

This wasn't meant as a boast ... ':-/
blush

 I was already writting the next generation layout engine for 
 glass, and tought that this would be a perfect opportunity 
 for a test drive in a real application.  

Oh no, the cat's out of the bag three months early...
I might as well admit it, I AM working on glass once again...


 Instead of coding yet another tool which no one will really 
 look at, I thought I'd push it subversively and then, when 
 glass is released later this year, let everyone know that 
 they've been using a small portion of it already.  :-)

Talk about ruinning a surprise release.  Really, this was meant to stay utterly secret 
until completely finished!!  can some one kick me in the eye while where at it, it'll 
change the pain!  


':-O

  DOH! DOH! DOH!


cheers!

-MAx

PS:  DOH!


-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.



[REBOL] Re: Did I do something wrong?

2004-02-23 Thread gregb

Sunanda,

 Greg:
 
  I posted a question to this list more than 24 hours ago but nobody
   made any comments. Did I post incorrectly?
 
 Sorry. I guess we all missed your original message.
 
 I think it's a problem with what gets run at REBOL.com to upgrade.  Here's
 a previous thread on the issue:
 
 http://www.rebol.org/cgi-bin/cgiwrap/rebol/ml-display-thread.r?m=rmlXFMK
 
 As the automatic upgrade isn't working, you could go to:
 http://www.rebol.com/platforms.shtml
 and crank the handle manually.
 
 Sunanda.

Thanks for your help. I'm happy the mailing list is working for me...

Greg Benjamin
-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.



[REBOL] Can I define an anti function?

2004-02-23 Thread Ladislav Mecir

Doc draw my attention to the %subject%, which was discussed at 
comp.lang.scheme. The thread started with:

{Suppose f is a function returning a boolean.Is there a way of defining 
a function anti, which, when given f, returns not f?}

the discussion continued:

{
 (define (anti f)

(lambda args
  (not (apply f args

  Why is this objectionable?  It provides the ability to do something that 
  hardly any other languages can do.
}

{
 This last statement is a bit too strong, even in Python you can do

Sheesh, I clearly said hardly any other languages, not no other 
languages.  I stand by my original statement -- most programming 
languages can't do this.  Python and Scheme are some of the few that 
can.  C can do it for functions of a specific arity, but can't 
generalize (e.g. you can write anti_f1 for 1-argument functions, anti_f2 
for 2-argument functions, etc.)
}

{
I expect most general-purpose dynamically typed languages can, at least
those using a conventional syntax. Perl can, Ruby can (but its treatment
of higher orded functions is weird), Dylan can, and probably all Lisp
variants too.

Smalltalk can't because variable arity doesn't make sense: the method name
implies the arity syntactically. Rebol probably can't: here the arity of a
function tells how many words to parse as its argument and where the next
function call begins. Forth and Postscript can't.

Among statically typed languages C# can, and it's the only one I know.
}

Question: Is the guess about Rebol correct? (I will post my answer later)

-L


-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.



[REBOL] Time, seconds and scientific notation

2004-02-23 Thread Hallvard Ystad

Hi list,

This is from a console session:
 third 0:00:01.09
== 1.09
 third 0:00:0.09
== 9E-2

How can I have the second example printed without scientific notation (as seconds)?

Thanks,
HY

Prætera censeo Carthaginem esse delendam


-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.



[REBOL] browser plugin TBA - was Re: [ANN] [REBOL.org] Packages -- first release

2004-02-23 Thread Graham Chiu
Maxim Olivier-Adlhoch  wrote.. apparently on 23-Feb-2004/12:34:46-5:00

I was already writting the next generation layout engine for glass, and tought that 
this would be a perfect opportunity for a test drive in a real application.  

Instead of coding yet another tool which no one will really look at, I thought I'd 
push it subversively and then, when glass is released later this year, let everyone 
know that they've been using a small portion of it already.  :-)

I don't think it has been mentioned on this list, but RT is going to release a beta 
test of an IE explorer plug in for Rebol this week.

It would be great if very visible applications worked with the plugin.
View 1.3 is being modified for greater compatibility ...

--
Graham Chiu
http://www.compkarori.com/cerebrus
-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.



[REBOL] Re: No-wait

2004-02-23 Thread Paul Tretter

Yeah Pekr, I was aware of what was returned by the port and was just using
it as an example.  I did write a small beginner tutorial for that covered
here:

http://www.rebol.net/cookbook/recipes/0034.html

However, I was using the small reference of code to demonstrate the blocking
aspect of the port despite no-wait.  So I have a fix for my problem but not
a good definition of what no-wait does.  From /core docs:

  Nowait port will not wait for data

However it seems that the port does sit and wait.

Paul


- Original Message - 
From: Petr Krenzelok [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 23, 2004 8:19 AM
Subject: [REBOL] Re: No-wait



 Paul Tretter napsal(a):

 Yeah this was my current work around to use 0 as a timeout but I was a
 wondering why it was needed if there was no-wait.
 
 
 It was not imo. Your code was imo wrong for what you wanted to achieve:

 port: open/direct/no-wait tcp://:7000
 x: 0

 forever [
print x + 1
x: x + 1
data: first wait port
 ]

 Do you know what above code is basically doing? You opened so called
 listen socket - TCP channel assigned to you by OS. That kind of socket
 is able to accept new connections, nothing more. One there is new client
 asking for connection, it simply assigns it other type of socket, so
 called communication socket. Just look at 'probe of given port and look
 for 'local-port item - that is the port assigned to you by OS.

 So basically - what did you expect your above code will do? I think I
 can tell you :-) Your 'forever loop will hang on, untill there is new
 connection coming. Just open second console and type-in:

 client: open tcp://127.0.0.1:7000

 and your 'x will counter will be raised by 1 - You created nothing more,
 than connection counter. For that, you choosed wrong name 'data. I would
 suggest:

 console1:
 -
 server: open/direct/no-wait tcp://:7000
 conn: first wait server

 forever [
 wait conn
 data: copy conn
 print mold data
 ]

 console2:
 -
 client: open tcp://127.0.0.1:7000
 data: read %user.r
 forever [
insert client data
wait 5
 ]

 Just copy and paste and watch your simple client/server communication
  you can put your console code in another loop, which will be able
 to accept several connection, wait on list of clients connected and
 voila, - you've got your tcp multiplexing engine running.

 Wouldn't above short description/example make it for short beginner's
 tutorial? :-) ... except the fact, that I am beginner too :-)

 Cheers,
 -pekr-


 Paul
 
 

 -- 
 To unsubscribe from this list, just send an email to
 [EMAIL PROTECTED] with unsubscribe as the subject.



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.577 / Virus Database: 366 - Release Date: 2/3/2004

-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.



[REBOL] Re: Time, seconds and scientific notation

2004-02-23 Thread SunandaDH

Hallvard:
  How can I have the second example printed without scientific notation (as 
 seconds)?

I suspect you are running under Windows. Other platforms don't go scientific 
for just 2 decimal places. Windows does, even for non-time values:

print .01
 print .01
1E-2

I don't think there is an easy solution, other than to write a decimal 
formatter yourself.

Here's a cheap Windows trick -- assuming you only want 2 decimal places:

 print replace mold to money! .01 $ 
0.01


Sunanda.
-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.



[REBOL] Re: Can I define an anti function?

2004-02-23 Thread Romano Paolo Tenca

My first attempt, but i do not know if it is a right answer:

antif: func [:f [any-function!] args[block!]][do head insert copy args :f]

---
Ciao
Romano

- Original Message - 
From: Ladislav Mecir [EMAIL PROTECTED]
To: Rebol List [EMAIL PROTECTED]
Sent: Monday, February 23, 2004 8:55 PM
Subject: [REBOL] Can I define an anti function?



 Doc draw my attention to the %subject%, which was discussed at
 comp.lang.scheme. The thread started with:

 {Suppose f is a function returning a boolean.Is there a way of defining
 a function anti, which, when given f, returns not f?}

 the discussion continued:

 {
  (define (anti f)

 (lambda args
   (not (apply f args

   Why is this objectionable?  It provides the ability to do something that
   hardly any other languages can do.
 }

 {
  This last statement is a bit too strong, even in Python you can do

 Sheesh, I clearly said hardly any other languages, not no other
 languages.  I stand by my original statement -- most programming
 languages can't do this.  Python and Scheme are some of the few that
 can.  C can do it for functions of a specific arity, but can't
 generalize (e.g. you can write anti_f1 for 1-argument functions, anti_f2
 for 2-argument functions, etc.)
 }

 {
 I expect most general-purpose dynamically typed languages can, at least
 those using a conventional syntax. Perl can, Ruby can (but its treatment
 of higher orded functions is weird), Dylan can, and probably all Lisp
 variants too.

 Smalltalk can't because variable arity doesn't make sense: the method name
 implies the arity syntactically. Rebol probably can't: here the arity of a
 function tells how many words to parse as its argument and where the next
 function call begins. Forth and Postscript can't.

 Among statically typed languages C# can, and it's the only one I know.
 }

 Question: Is the guess about Rebol correct? (I will post my answer later)

 -L


 -- 
 To unsubscribe from this list, just send an email to
 [EMAIL PROTECTED] with unsubscribe as the subject.


-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.



[REBOL] Re: Time, seconds and scientific notation

2004-02-23 Thread Maxim Olivier-Adlhoch

if you have an old version of my steel utils, there is a as-string type converter 
which will convert decimals to strings with a user selected number of digits after the 
decimal point...

other wise, you'll have to wait for me to find it... and send it to rebol.org later 
tonight.

-MAx
---
You can either be part of the problem or part of the solution, but in the end, being 
part of the problem is much more fun.
 

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Monday, February 23, 2004 4:18 PM
 To: [EMAIL PROTECTED]
 Subject: [REBOL] Re: Time, seconds and scientific notation
 
 
 
 Hallvard:
   How can I have the second example printed without 
 scientific notation (as 
  seconds)?
 
 I suspect you are running under Windows. Other platforms 
 don't go scientific 
 for just 2 decimal places. Windows does, even for non-time values:
 
 print .01
  print .01
 1E-2
 
 I don't think there is an easy solution, other than to write 
 a decimal 
 formatter yourself.
 
 Here's a cheap Windows trick -- assuming you only want 2 
 decimal places:
 
  print replace mold to money! .01 $ 
 0.01
 
 
 Sunanda.
 -- 
 To unsubscribe from this list, just send an email to
 [EMAIL PROTECTED] with unsubscribe as the subject.
 
 

-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.



[REBOL] Re: Can I define an anti function?

2004-02-23 Thread Romano Paolo Tenca

Obviously I forgot the not. But perhaps i mis-interpreted the syntax required
but the antif function. If it is tha case, can you do some examples ot the
required syntax?


---
Ciao
Romano

- Original Message - 
From: Romano Paolo Tenca [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 23, 2004 10:31 PM
Subject: [REBOL] Re: Can I define an anti function?



 My first attempt, but i do not know if it is a right answer:

 antif: func [:f [any-function!] args[block!]][do head insert copy args
:f]

 ---
 Ciao
 Romano

 - Original Message - 
 From: Ladislav Mecir [EMAIL PROTECTED]
 To: Rebol List [EMAIL PROTECTED]
 Sent: Monday, February 23, 2004 8:55 PM
 Subject: [REBOL] Can I define an anti function?


 
  Doc draw my attention to the %subject%, which was discussed at
  comp.lang.scheme. The thread started with:
 
  {Suppose f is a function returning a boolean.Is there a way of defining
  a function anti, which, when given f, returns not f?}
 
  the discussion continued:
 
  {
   (define (anti f)
 
  (lambda args
(not (apply f args
 
Why is this objectionable?  It provides the ability to do something
that
hardly any other languages can do.
  }
 
  {
   This last statement is a bit too strong, even in Python you can do
 
  Sheesh, I clearly said hardly any other languages, not no other
  languages.  I stand by my original statement -- most programming
  languages can't do this.  Python and Scheme are some of the few that
  can.  C can do it for functions of a specific arity, but can't
  generalize (e.g. you can write anti_f1 for 1-argument functions, anti_f2
  for 2-argument functions, etc.)
  }
 
  {
  I expect most general-purpose dynamically typed languages can, at least
  those using a conventional syntax. Perl can, Ruby can (but its treatment
  of higher orded functions is weird), Dylan can, and probably all Lisp
  variants too.
 
  Smalltalk can't because variable arity doesn't make sense: the method name
  implies the arity syntactically. Rebol probably can't: here the arity of a
  function tells how many words to parse as its argument and where the next
  function call begins. Forth and Postscript can't.
 
  Among statically typed languages C# can, and it's the only one I know.
  }
 
  Question: Is the guess about Rebol correct? (I will post my answer later)
 
  -L
 
 
  -- 
  To unsubscribe from this list, just send an email to
  [EMAIL PROTECTED] with unsubscribe as the subject.
 

 -- 
 To unsubscribe from this list, just send an email to
 [EMAIL PROTECTED] with unsubscribe as the subject.


-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.



[REBOL] Re: No-wait

2004-02-23 Thread Andreas Bolka


Monday, February 23, 2004, 9:47:33 PM, Paul wrote:

 However, I was using the small reference of code to demonstrate the
 blocking aspect of the port despite no-wait. So I have a fix for my
 problem but not a good definition of what no-wait does. From /core
 docs:

   Nowait port will not wait for data

 However it seems that the port does sit and wait.

It does not. 'wait will not block on the client port, but only on the
server port. Use 'wait on the server port with a timeout value (e.g.
0.02) if you don't want to block while waiting for a client to
connect.

-- 
Best regards,
 Andreas


-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.



[REBOL] Re: Time, seconds and scientific notation

2004-02-23 Thread Hallvard Ystad

Dixit [EMAIL PROTECTED] (22.18 23.02.2004):

Hallvard:
  How can I have the second example printed without scientific notation (as 
 seconds)?

I suspect you are running under Windows. Other platforms don't go scientific 
for just 2 decimal places. Windows does, even for non-time values:

Ah! Problem solved. I'm on a MacOSX, just testing things on a win2k. Phew. Thanks.
HY

Prætera censeo Carthaginem esse delendam


-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.



[REBOL] Re: No-wait

2004-02-23 Thread Paul Tretter

Excellent, Finally got the answer to it.  I knew there had to be a purpose.
I tried an example:

fetch: open tcp://www.rebol.com:80
copy fetch


fetch: open/no-wait tcp://www.rebol.com:80
copy fetch

Good, now I know to only use no-wait for client ports.  Thanks Andreas.

Paul Tretter

- Original Message - 
From: Andreas Bolka [EMAIL PROTECTED]
To: Paul Tretter [EMAIL PROTECTED]
Sent: Monday, February 23, 2004 4:07 PM
Subject: [REBOL] Re: No-wait




 Monday, February 23, 2004, 9:47:33 PM, Paul wrote:

  However, I was using the small reference of code to demonstrate the
  blocking aspect of the port despite no-wait. So I have a fix for my
  problem but not a good definition of what no-wait does. From /core
  docs:

Nowait port will not wait for data

  However it seems that the port does sit and wait.

 It does not. 'wait will not block on the client port, but only on the
 server port. Use 'wait on the server port with a timeout value (e.g.
 0.02) if you don't want to block while waiting for a client to
 connect.

 -- 
 Best regards,
  Andreas


 -- 
 To unsubscribe from this list, just send an email to
 [EMAIL PROTECTED] with unsubscribe as the subject.



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.577 / Virus Database: 366 - Release Date: 2/3/2004

-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.



[REBOL] Re: Can I define an anti function?

2004-02-23 Thread Ladislav Mecir

Romano Paolo Tenca napsal(a):

My first attempt, but i do not know if it is a right answer:

antif: func [:f [any-function!] args[block!]][do head insert copy args :f]

---
Ciao
Romano
  

It isn't, because it takes 2 arguments, while ANTI has to take just one: F

-L

-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.



[REBOL] port/awake (was no-wait)

2004-02-23 Thread Paul Tretter

What is the false for in the awake function?

- Original Message - 
From: Gabriele Santilli [EMAIL PROTECTED]
To: Paul Tretter [EMAIL PROTECTED]
Sent: Monday, February 23, 2004 5:14 AM
Subject: [REBOL] Re: No-wait



 Hi Paul,

 On Monday, February 23, 2004, 4:31:01 AM, you wrote:

 PT Even that still blocks.  Need a way of not waiting for the port data
if
 PT nothing is there.  A way to just continue processing the rest of the
forever
 PT loop which should be continously print the current value of x.  Maybe,
I
 PT need to see an example of something that works.

 listen: open/no-wait tcp://:7000
 listen/awake: func [port /local conn] [
 print Got connection
 conn: first port
 ; do something with conn
 false
 ]
 insert tail system/ports/wait-list listen
 x: 0
 forever [
 print x: x + 1
 wait 0.2
 ]

 Regards,
Gabriele.
 -- 
 Gabriele Santilli [EMAIL PROTECTED]  --  REBOL Programmer
 Amiga Group Italia sez. L'Aquila  ---   SOON: http://www.rebol.it/

 -- 
 To unsubscribe from this list, just send an email to
 [EMAIL PROTECTED] with unsubscribe as the subject.



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.577 / Virus Database: 366 - Release Date: 2/3/2004

-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.



[REBOL] Time, seconds and scientific notation

2004-02-23 Thread Graham Chiu
Hallvard Ystad  wrote.. apparently on 23-Feb-2004/21:00:15+1:00
Hi list,

This is from a console session:
 third 0:00:01.09
== 1.09
 third 0:00:0.09
== 9E-2

How can I have the second example printed without scientific notation (as seconds)?


Here's a function from Gabriele that does this in case someone else needs it.

http://www.compkarori.com/vanilla/display/form-decimal.r

--
Graham Chiu
http://www.compkarori.com/cerebrus
-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.