<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.comp.lang.racket.user">
    <title>gmane.comp.lang.racket.user</title>
    <link>http://blog.gmane.org/gmane.comp.lang.racket.user</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.racket.user/17963"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.racket.user/17962"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.racket.user/17961"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.racket.user/17960"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.racket.user/17959"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.racket.user/17958"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.racket.user/17957"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.racket.user/17956"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.racket.user/17955"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.racket.user/17954"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.racket.user/17953"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.racket.user/17952"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.racket.user/17951"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.racket.user/17950"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.racket.user/17949"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.racket.user/17948"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.racket.user/17947"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.racket.user/17946"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.racket.user/17945"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.racket.user/17944"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.racket.user/17963">
    <title>Re: Problem Stream with alternating values</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.racket.user/17963</link>
    <description>&lt;pre&gt;so ... the H1 recursion is evaluating it's arguments, producing a list
instead of a stream?

I based this on the ones function with the H1 helper function to act as
a toggle.

However, closer adherence to the 'ones' example and consing both values
at the same time works just fine, and is much more concise:-

(define (dan-then-dog)
  (stream-cons dan
               (stream-cons dog (dan-then-dog))
  ))


Thanks,
Patrick Sweetman

On 19/05/2013 14:06, Robby Findler wrote:

____________________
  Racket Users list:
  http://lists.racket-lang.org/users

&lt;/pre&gt;</description>
    <dc:creator>Patrick Sweetman</dc:creator>
    <dc:date>2013-05-19T10:16:55</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.racket.user/17962">
    <title>Re: Problem Stream with alternating values</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.racket.user/17962</link>
    <description>&lt;pre&gt;Your function H1 is not lazy enough.

Closely following the instructions of the exercise I immediately come with:

(define (dan-then-dog)
 (cons "dan.jpg"
  (lambda () ???)))

Can you fill in the question-marks?

Can easily be done with stream-cons too:

(define dan-then-dog-str (stream-cons "dan.jpg" ...))

but this is not according to the exercise, I think. In the exersize a stream
is defined as a thunk.

Jos


____________________
  Racket Users list:
  http://lists.racket-lang.org/users

&lt;/pre&gt;</description>
    <dc:creator>Jos Koot</dc:creator>
    <dc:date>2013-05-19T09:22:41</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.racket.user/17961">
    <title>Re: Problem Stream with alternating values</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.racket.user/17961</link>
    <description>&lt;pre&gt;If you were to replace stream-cons with this function:

(define (not-stream-cons x y) (printf "x ~s y ~s\n" x y) 'something-random)

would it make sense to you what happens?

Robby


On Thu, May 16, 2013 at 7:30 AM, Patrick Sweetman &amp;lt;sweetmanpc-A4zZcstk72OlP80pJB477g&amp;lt; at &amp;gt;public.gmane.org&amp;gt;wrote:

____________________
  Racket Users list:
  http://lists.racket-lang.org/users
&lt;/pre&gt;</description>
    <dc:creator>Robby Findler</dc:creator>
    <dc:date>2013-05-19T02:06:02</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.racket.user/17960">
    <title>Problem Stream with alternating values</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.racket.user/17960</link>
    <description>&lt;pre&gt;I'm doing this problem:

6. Write a stream dan-then-dog, where the elements of the stream
alternate between the strings "dan.jpg" and "dog.jpg" (starting with
"dan.jpg"). More specically, dan-then-dog should be a thunk that when
called produces a pair of "dan.jpg" and a thunk that when called
produces a pair of "dog.jpg" and a thunk that when called... etc. Sample
solution: 4 lines.

and I cannot for the life of me understand why the following code does
not produce a properly thunked stream. It evaluates the entries until it
runs out of memory

(define dan "dan.jpg")
(define dog "dog.jpg")

(define (dan-then-dog)
  (define (H1 st0 b0)
    (cond
      [(= b0 1) (H1 (stream-cons dan st0) 0)]
      [else     (H1 (stream-cons dog st0) 1)]
      )
    )
  (H1 empty-stream 1))

Can somebody please explain why my understanding of Racket streams is
faulty?

Thanks,
Patrick Sweetman
____________________
  Racket Users list:
  http://lists.racket-lang.org/users

&lt;/pre&gt;</description>
    <dc:creator>Patrick Sweetman</dc:creator>
    <dc:date>2013-05-16T12:30:48</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.racket.user/17959">
    <title>Re: Racket 5.3.4 doesn't build aginst libpng 1.6</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.racket.user/17959</link>
    <description>&lt;pre&gt;
Thanks. The patch works.


____________________
  Racket Users list:
  http://lists.racket-lang.org/users
&lt;/pre&gt;</description>
    <dc:creator>Eric Bélanger</dc:creator>
    <dc:date>2013-05-18T00:42:46</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.racket.user/17958">
    <title>Re: classroom response system</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.racket.user/17958</link>
    <description>&lt;pre&gt;
On May 17, 2013, at 1:36 PM, Danny Heap wrote:


Sounds very cool, and eminently do-able. Besides the existing stepper, I had a student that started looking at integrating DrRacket's stepper with Philip Guo's "Online Python Tutor". Let me know if you want pointers to some code.

John


____________________
  Racket Users list:
  http://lists.racket-lang.org/users

&lt;/pre&gt;</description>
    <dc:creator>John Clements</dc:creator>
    <dc:date>2013-05-18T00:34:10</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.racket.user/17957">
    <title>Re: classroom response system</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.racket.user/17957</link>
    <description>&lt;pre&gt;Arjun Guha (CC'ed) wrote TestFest in Racket
(https://github.com/brownplt/testfest) a few years ago to run
students' tests and implementations against one another.  It seems
pretty close to what you want, and might be a good place to start.

Cheers!
Joe

On Fri, May 17, 2013 at 4:36 PM, Danny Heap &amp;lt;heap-26n5VD7DAF2Tm46uYYfjYg&amp;lt; at &amp;gt;public.gmane.org&amp;gt; wrote:
____________________
  Racket Users list:
  http://lists.racket-lang.org/users

&lt;/pre&gt;</description>
    <dc:creator>Joe Gibbs Politz</dc:creator>
    <dc:date>2013-05-17T23:23:56</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.racket.user/17956">
    <title>Re: Unicode character name</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.racket.user/17956</link>
    <description>&lt;pre&gt;Ok, I'll look into this in a few days.  I'm in the midst of moving, so I'm
very distracted right now.  ;)
____________________
  Racket Users list:
  http://lists.racket-lang.org/users
&lt;/pre&gt;</description>
    <dc:creator>Danny Yoo</dc:creator>
    <dc:date>2013-05-17T22:56:21</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.racket.user/17955">
    <title>classroom response system</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.racket.user/17955</link>
    <description>&lt;pre&gt;A colleague has developed a classroom response tool that allows
students to download exercises, write solutions, and then either
visualize the execution of their solution or run unit tests, and then
submit their solution.  The instructor can display a histogram of of
the submissions that passed various tests, and then sample some of the
interesting examples to discuss with the class (all this assumes
wireless coverage for the classroom).

This is currently implemented for Python, but my colleague wants to
extend it to other languages.  He has a student looking into the
feasibility of implementing it for DrRacket, with the rough idea
being:

-- Students and instructors run local instances of DrRacket
           (hence access to the Stepper for student languages)
-- Run the tests either client- or server-side in a sandbox
-- Get files to/from DrRacket to server somehow

Since either students or the instructor will want to load files that
are stored remotely (either starter code for exercises or student
submissions), we're trying to figure out how DrRacket can open code
that lives at a URL in the definitions pane.  Any suggestions are very
welcome.  Also, anyone who is curious about the project is welcome to
contact Andrew Petersen &amp;lt;andrew.petersen-H217xnMUJC0sA/PxXw9srA&amp;lt; at &amp;gt;public.gmane.org&amp;gt;.


&lt;/pre&gt;</description>
    <dc:creator>Danny Heap</dc:creator>
    <dc:date>2013-05-17T20:36:57</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.racket.user/17954">
    <title>Re: Duplicating output from a system call</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.racket.user/17954</link>
    <description>&lt;pre&gt;I went to do my "tee" workaround that I assumed would work, and I
discovered that it suffers from the same issue. I then just ran the command
without Racket but included the pipe to tee and none of the output is shown
until the process finishes. The same thing happened when I pipe to less.
There's obviously something weird going on with that process and piping or
redirecting output that has nothing to do with Racket.

Also, thanks for the code Neil, I'll keep that in mind when I need to do
more intensive processing. My current needs are just to search the logs for
the presence of a "Fail:" string, which indicates a failure. I know the
problem is simple enough that I probably could have just piped to grep or
something, but I'm not very familiar or comfortable with command-line tools
and bash programming, and the last time I tried to do something like this
in bash, this unfamiliarity bit me a lot. Plus, I like finding
opportunities to use Racket at work so I can get paid to become more
familiar with a language I like using.

Thanks again for all the help. Sorry if my misdiagnosis of the problem
wasted anyone's time.


On Thu, May 16, 2013 at 11:01 PM, Neil Van Dyke &amp;lt;neil-iSOEUaFOKGKgBLj5vKMu3A&amp;lt; at &amp;gt;public.gmane.org&amp;gt;wrote:

____________________
  Racket Users list:
  http://lists.racket-lang.org/users
&lt;/pre&gt;</description>
    <dc:creator>Nick Shelley</dc:creator>
    <dc:date>2013-05-17T17:14:42</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.racket.user/17953">
    <title>Re: thread size and creation time</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.racket.user/17953</link>
    <description>&lt;pre&gt;By "very long process", I had in mind "years", but there could be a
shorter path.

The current Racket implementation internally has a construct for
"lightweight continuations" that are used to implement futures. Those
continuations can be lightweight because they are used only as long as
the future stays simple (i.e., stays in the subset of Racket that
allows futures to run in parallel). It should work to similarly use a
lightweight continuation for a thread, as long as the thread stays
simple enough.

How easily we can get from here to there depends on which primitives
you imagine using in the threads.

At Mon, 13 May 2013 13:43:37 +0200, Berthold Bäuml wrote:

____________________
  Racket Users list:
  http://lists.racket-lang.org/users
&lt;/pre&gt;</description>
    <dc:creator>Matthew Flatt</dc:creator>
    <dc:date>2013-05-17T11:47:31</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.racket.user/17952">
    <title>Re: raco setup and compile-collection-zos</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.racket.user/17952</link>
    <description>&lt;pre&gt;Just in case, is there any update on that?
I'd prefer to use `compile-collection-zos' than 'raco setup' within a
system call, because it allows me to catch the exceptions in case it fails
(and it's cleaner).

The goal is to have a program (rwind) recompile itself and, on success,
restart itself.
In case of compilation failure, I want to display the exception.

But when I try `(compile-collection-zos "rwind")', it fails with:
make-directory: cannot make directory
path: /usr/lib/racket-5.3.4.10/collects/syntax/parse/private/compiled/debug/
system error: Permission non accordée; errno=13

(permission denied)

Thanks,
Laurent


On Wed, Feb 20, 2013 at 5:36 PM, Laurent &amp;lt;laurent.orseau-Re5JQEeQqe8AvxtiuMwx3w&amp;lt; at &amp;gt;public.gmane.org&amp;gt; wrote:

____________________
  Racket Users list:
  http://lists.racket-lang.org/users
&lt;/pre&gt;</description>
    <dc:creator>Laurent</dc:creator>
    <dc:date>2013-05-17T10:39:57</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.racket.user/17951">
    <title>Re: Duplicating output from a system call</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.racket.user/17951</link>
    <description>&lt;pre&gt;If you change the "process*" call in the below program to run your 
command, and run this program in DrRacket with "View -&amp;gt; Show Log", 
hopefully you see the output from your command promptly.

#lang racket/base

(require racket/system)

(apply (lambda (stdout-in
                 stdin-out
                 pid
                 stderr-in
                 process-proc)
          (let* ((buf-size  4096)
                 (buf-bytes (make-bytes buf-size)))
            (let loop ()
              (let ((evt (sync/enable-break stdout-in stderr-in)))
                ;; ...
                (let ((read-result (read-bytes-avail! buf-bytes evt)))
                  (cond ((eof-object? read-result)
                         (log-error "EOF!")
                         ;; ...
                         (void))
                        ;; ...
                        (else
                         (log-error "OUTPUT: ~S" (subbytes buf-bytes 0 
read-result))
                         (loop))))))
            ;; ...
            (close-output-port stdin-out)
            (close-input-port  stdout-in)
            (close-input-port  stderr-in)))
        (process* "/bin/sh"
                  "-c"
                  "while true ; do echo -n abc ; sleep 3 ; done"))

(I wrote the code this particular way, using a bytes buffer, because 
it's a good starting point for doing fancier things, such as if you're 
trying to recognize particular output and handle it specially, or if 
you're interacting with the process.  This is as far as I can help, 
though.  Depending on the entirety of what you want to do with the 
output, getting this right can easily take hours and end up looking like 
systems programming.  Or you can look at doing it with first-class 
continuations, which should be more elegant, but continuations hurt 
people's brains initially, and i'm not sure how performance would compare.)

Neil V.

____________________
  Racket Users list:
  http://lists.racket-lang.org/users

&lt;/pre&gt;</description>
    <dc:creator>Neil Van Dyke</dc:creator>
    <dc:date>2013-05-17T05:01:12</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.racket.user/17950">
    <title>Re: Duplicating output from a system call</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.racket.user/17950</link>
    <description>&lt;pre&gt;I scanned that file and it seems like it collects the output at the end of
the process, which isn't quite what I need. Thanks for the pointer though.

I also tried closing the ports, but that didn't help.

I've been trying to reduce my code to a minimum working/non-working
example, and it hasn't helped much. Basically I found out that every other
command I tried worked fine, but the instruments one doesn't work with the
copy-port stuff (it works when run by itself). For instance, I tried "raco
test" on some personal code with the copy-port stuff and it logged in
real-time just fine. I also tried "brew upgrade" and it logged the results
in real time. But for some reason the command I'm using doesn't seem to
work.

I think I'm just going to use the tee workaround for now.

Thanks for the time and pointers. I definitely learned a few things, so it
wasn't a complete waste for me at least.

If there are any perfectionists that still want to figure this out, I'm
just running iOS UI Automation tests as described here:

http://stackoverflow.com/questions/4191945/can-the-ui-automation-instrument-be-run-from-the-command-line

Although I doubt there are many people who've been enlightened by Racket
yet still stoop to writing Objective-C code...


On Thu, May 16, 2013 at 9:09 PM, Jay McCarthy &amp;lt;jay.mccarthy-Re5JQEeQqe8AvxtiuMwx3w&amp;lt; at &amp;gt;public.gmane.org&amp;gt;wrote:

____________________
  Racket Users list:
  http://lists.racket-lang.org/users
&lt;/pre&gt;</description>
    <dc:creator>Nick Shelley</dc:creator>
    <dc:date>2013-05-17T04:04:41</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.racket.user/17949">
    <title>Re: Duplicating output from a system call</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.racket.user/17949</link>
    <description>&lt;pre&gt;I'm showing up late to this party, but...

DrDr has to do this in a very reliable way and it is abstracted into a
fairly nice function called run/collect/wait

https://github.com/plt/racket/blob/master/collects/meta/drdr/run-collect.rkt

You may want to look at it a little.

Jay

On Thu, May 16, 2013 at 6:43 PM, Robby Findler
&amp;lt;robby-5YcgHWA4rVnfxgxxWyf0drK6bRJNSFrb&amp;lt; at &amp;gt;public.gmane.org&amp;gt; wrote:



&lt;/pre&gt;</description>
    <dc:creator>Jay McCarthy</dc:creator>
    <dc:date>2013-05-17T03:09:23</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.racket.user/17948">
    <title>Re: Duplicating output from a system call</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.racket.user/17948</link>
    <description>&lt;pre&gt;Oh, I meant to say that I think that process*/ports can make things easier
than system for this kind of thing. read-string-evt is more for if you want
to get good performance for high-throughput streams, which it seems like
isn't an issue here. This different seems unlikely to help with whatever is
going wrong.

I don't see that you're closing the ports anywhere, so maybe there is
something like that happening in your real script. Make sure that you close
everything as soon as you know there is no more data. Otherwise, I'm just
not sure what's going wrong.

As for process* and system*: they will work, I think, unless the strings
you put in the "~a"s are multiple arguments and you can't do that parsing
yourself. You'd do something like

  (system* "/usr/bin/instruments" "-t" (path-&amp;gt;string instruments-path)
(path-&amp;gt;string app-path) "-e" "UIASCRIPT" (path-&amp;gt;string script-path))

roughly.

Robby


On Thu, May 16, 2013 at 7:27 PM, Nick Shelley &amp;lt;nickmshelley-Re5JQEeQqe8AvxtiuMwx3w&amp;lt; at &amp;gt;public.gmane.org&amp;gt;wrote:

____________________
  Racket Users list:
  http://lists.racket-lang.org/users
&lt;/pre&gt;</description>
    <dc:creator>Robby Findler</dc:creator>
    <dc:date>2013-05-17T00:43:58</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.racket.user/17947">
    <title>Re: Duplicating output from a system call</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.racket.user/17947</link>
    <description>&lt;pre&gt;I tried "file-stream-buffer-mode" on the stdout port and that didn't help.
That seems to be the only port that will work with that method.

I also realize I misled you when I put "&amp;lt;script-that-logs-to-console&amp;gt;" as a
placeholder in the code. Really it is a command of the form (format
"instruments -t ~a \"~a\" -e UIASCRIPT ~a" ...) where two of the three ~a
arguments are passed to Racket through the command-line. If I understand
correctly, process* and system* won't work with this form.

After experimenting a bunch unsuccessfully, I tried putting the system call
before I created the ports and without a parameterized current-output-port.
The results I see are that for the first system call I get real-time logs
to the console, then with the next one the tests repeat, but the logs don't
come until the end.

I even tried Neil's suggested approach in case that made a difference.
Aside from the fact that it has the same buffering problem, I never get the
eof event, so I don't know when to terminate the sync loop. Here's the code:

  (define-values (in out) (make-pipe))
  (define stdout (current-output-port))
  (define string-port (open-output-string))
  (process/ports out #f #f (format "instruments -t ~a \"~a\" -e UIASCRIPT
~a" instruments-path app-path script-path))
  (let loop ([data (sync (read-string-evt 1 in))])
    (unless (eof-object? data)
      (display (format "data: [~a]" data) stdout)
      (display data string-port)
      (loop (sync (read-string-evt 1 in)))))
  (printf "~n~nresults: ~a~n" (get-output-string string-port))

With this I get the delayed logs (each letter in brackets per sync event)
and then the program hangs waiting for an eof that never comes. Out of
curiosity, why did both of you recommend this approach over the system
approach? Either I'm doing it completely wrong or I just can't see the
advantage.


On Thu, May 16, 2013 at 5:08 PM, Neil Van Dyke &amp;lt;neil-iSOEUaFOKGKgBLj5vKMu3A&amp;lt; at &amp;gt;public.gmane.org&amp;gt; wrote:

____________________
  Racket Users list:
  http://lists.racket-lang.org/users
&lt;/pre&gt;</description>
    <dc:creator>Nick Shelley</dc:creator>
    <dc:date>2013-05-17T00:27:07</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.racket.user/17946">
    <title>Re: Duplicating output from a system call</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.racket.user/17946</link>
    <description>&lt;pre&gt;You can try "file-stream-buffer-mode" on the port.

Neil V.

____________________
  Racket Users list:
  http://lists.racket-lang.org/users

&lt;/pre&gt;</description>
    <dc:creator>Neil Van Dyke</dc:creator>
    <dc:date>2013-05-16T23:08:10</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.racket.user/17945">
    <title>Re: Duplicating output from a system call</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.racket.user/17945</link>
    <description>&lt;pre&gt;I tried your code with this bash script:

#!/bin/sh
echo hi
sleep 1
echo bye

and I saw the "hi" a bit before the "bye" and the results printout. Is it
possible your script is not flushing its output?

Also I agree with Neil that process*/ports is going to be better in the
general case: it is more flexible than system (but if system* works, that
can be okay: it is only obviously better than process*).

Robby



On Thu, May 16, 2013 at 5:36 PM, Nick Shelley &amp;lt;nickmshelley-Re5JQEeQqe8AvxtiuMwx3w&amp;lt; at &amp;gt;public.gmane.org&amp;gt;wrote:

____________________
  Racket Users list:
  http://lists.racket-lang.org/users
&lt;/pre&gt;</description>
    <dc:creator>Robby Findler</dc:creator>
    <dc:date>2013-05-16T23:00:05</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.racket.user/17944">
    <title>Re: Duplicating output from a system call</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.racket.user/17944</link>
    <description>&lt;pre&gt;Thank you both for your responses.

I tried to get Robby's to work because it seemed a little simpler, but I
think I'm having buffering problems. I could have completely misunderstood
the proposed solution as well...

Here's the relavent code:

  (define-values (in out) (make-pipe))
  (define stdout (current-output-port))
  (define string-port (open-output-string))
  (thread (λ () (copy-port in stdout string-port)))
  (thread (λ () (flush-output stdout)))
  (parameterize ([current-output-port out])
    (system &amp;lt;script-that-logs-to-console&amp;gt;))
  (printf "~n~nresults: ~a~n" (get-output-string string-port))

What I get is nothing until the script finishes, then I get the log message
from stdout followed by my "results: ..." message that contains a duplicate
of the logs. This is exactly what I want except that I want the logs to the
stdout port to print in real time. I added the flush-output thread as an
attempt to get around buffering, but I'm obviously misunderstanding
something because it still didn't work.


On Thu, May 16, 2013 at 2:24 PM, Robby Findler
&amp;lt;robby-5YcgHWA4rVnfxgxxWyf0drK6bRJNSFrb&amp;lt; at &amp;gt;public.gmane.org&amp;gt;wrote:

____________________
  Racket Users list:
  http://lists.racket-lang.org/users
&lt;/pre&gt;</description>
    <dc:creator>Nick Shelley</dc:creator>
    <dc:date>2013-05-16T22:36:09</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.racket.user/17943">
    <title>Re: RSound in ubuntu only works withdiagnose-sound-playing - can't choose library?</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.racket.user/17943</link>
    <description>&lt;pre&gt;
On May 16, 2013, at 1:59 PM, J. Ian Johnson wrote:


Okay, I've just spent some time scanning the portaudio mailing list, specifically WRT ALSA, and… I'm alarmed.

At this point, I'm wondering how many problems could be solved just by recompiling portaudio. Of course, that means getting ahold of a Windows machine again….

The real problem here is that I don't have a machine to try any of this on.

John




____________________
  Racket Users list:
  http://lists.racket-lang.org/users

&lt;/pre&gt;</description>
    <dc:creator>John Clements</dc:creator>
    <dc:date>2013-05-16T22:07:27</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.comp.lang.racket.user">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.lang.racket.user</link>
  </textinput>
</rdf:RDF>
