Newsgroups: comp.lang.dylan
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!gatech!newsxfer.itd.umich.edu!zip.eecs.umich.edu!newshost.marcam.com!news.mathworks.com!zombie.ncsc.mil!news.duke.edu!eff!news.umbc.edu!haven.umd.edu!ames!news.hawaii.edu!uhunix4.uhcc.Hawaii.Edu!phinely
From: phinely@uhunix4.uhcc.Hawaii.Edu (Peter Hinely)
Subject: Interfacing Mindy to C now?
X-Nntp-Posting-Host: uhunix4.uhcc.hawaii.edu
Message-ID: <D50rzo.3M@news.hawaii.edu>
Sender: news@news.hawaii.edu
Organization: University of Hawaii
Date: Mon, 6 Mar 1995 12:57:24 GMT
Lines: 40

     Maybe someone can help me out with question regarding Mindy.  I know
that Melange is not available yet, so it's not possible to directly
interface Mindy with C libraries.  Is it still possible to interface Mindy
with a complete, executable C program though?  I want to create a Dylan
interface to a C interface to a database management system that I am
playing around with. 

     The makeshift system I envision would be something like this: The
dylan program would send the query to be done via command line arguments
to a small C program that contained the interface to the DBMS that I am
using.  The C program would return the query results in one big chunk of
data to the Mindy program.  The Mindy program would then parse the data. 
The system I envision is ugly, but could it work? 

     It appears possible to run other programs from within a Mindy program
using the fd-exec function from the File-descriptor Module. 

fd-exec [Function]

      Arguments
            command-line :: <string>
      Values
            in-fd :: false-or(<integer>)
            out-fd :: false-or(<integer>)
      Description
            This function provides a facility for running programs and 
scripts from within Mindy. The command-line argument should contain the 
name of the program and all of the command line arguments for that 
program. This function returns the file descriptors for the new process's 
standard input and output. If fd-exec is unable to start the process, 
then it returns #f and #f.

     Now is it possible for my Mindy program to retrieve the stdout from
the C program that my Mindy program ran?  Any ideas how would I go about
doing it?  (I'm unix-challenged.) 

     Or is Melange going to appear anytime soon? 

Thanks in advance,
peter
