Input from listener in Apple Dylan 
Author Message
 Input from listener in Apple Dylan

Hi there,

Does anybody know of a way to get input from the listener when running
from the Application Nub (Using Apple Dylan)? I'm looking for something
like Mindy's read-line(*standard-input*).

Thanks,
Nimi Peleg



Fri, 19 Nov 1999 03:00:00 GMT  
 Input from listener in Apple Dylan


  >Does anybody know of a way to get input from the listener when running
  >from the Application Nub (Using Apple Dylan)? I'm looking for something
  >like Mindy's read-line(*standard-input*).

Try looking through the "New Streams" libraries in the "Sample Code"
folder. I haven't tested any of it myself, but the following comes from the
documentation:

/*
Line Oriented Input and Output

read-line stream, #key on-end-of-stream => string-or-eof, newline?

Read a line from the stream.  The second value is #t if the line terminated
with a newline character, which is not included in the returned string, or
#f if the line was terminated by the end of the stream.  If the stream is
already at the end, return on-end-of-stream if it was supplied, or if it
was not supplied, signal <end-of-stream-error>.

read-line-into! stream, string, #key start, on-end-of-stream
   => string-or-eof, newline?

Like read-line but puts the line into an existing string.

write-line stream, string, #key start, end

Write a string to a stream followed by a newline character.
*/


Los Angeles, CA   illustration & design |      {*filter*}dog mail system"
    http://www.*-*-*.com/ ~athene    | eti kai nun Hellada phileo

IBM 233 MHz PowerPC 604e unveiled: world's fastest microcomputer cpu



Fri, 26 Nov 1999 03:00:00 GMT  
 Input from listener in Apple Dylan

Marlais 0.5.11


  ==> {instance of class <stream>}


  ==> {the class <stream> (55)}


error: format: cannot send output to non-stream:
               {instance of class <stream>}.

This may be another MacMarlais specific problem, but more likely my
ignorance at play. "Dam'it Jim, I'm an artist not a professional
programmer."

format() works when the stream parameter is created from one of the I/O
routines (ie. open-input-file) or using a literal #t for listener I/O. Is
it that <stream> is an abstract class, so it's inappropriate for me to call
make on it? I know the other two environments provide more instances of
streams.

My end goal is to have a library that will take various instances of
<number> and return formated strings. I'd like to create the following
capabilities:

// pseudodylan

Quote:
> return-numeric-string (200000, #comma);

  ==> "200,000"

Quote:
> return-numeric-string (10 + 12.50, #money);

  ==> "$22.50"

I have been at a loss on how to accomplish this, but will keep trying.
However, I'm sure others here could solve this in short order.

TIA


Los Angeles, CA   illustration & design |      {*filter*}dog mail system"
    http://www.*-*-*.com/ ~athene    | eti kai nun Hellada phileo

IBM 233 MHz PowerPC 604e unveiled: world's fastest microcomputer cpu



Tue, 30 Nov 1999 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Dylan Programming Book and Apple Dylan

2. Dylan is the Name was(Re: Dylan (Bob) eats rotten Apple (Computer))

3. Dylan listener

4. Old Apple Dylan Archive

5. Apple Dylan TR

6. apple's dylan technology release CD

7. Apple Dylan t-shirt: Geek History though T-shirts

8. Apple's Dylan's FAQ postable?

9. Posting Apple's Dylan Ref Manual?

10. Regarding Apple Dylan

 

 
Powered by phpBB® Forum Software