Andreas Rottmann | 1 Oct 2005 13:57
Picon
Picon
Gravatar

[PATCH] exec48 script handler

Hi!

This patch implements a SRFI-22-style script handler for scripts
written in the Scheme48 exec language; this means you can provide a
"load file" written in the exec language for your applications, and
the user only has to run

scheme-exec48 foo-load.scm

to run the application.

Attachment (exec48-p1-r1420.patch): text/x-patch, 1555 bytes

Regards, Rotty
--

-- 
Andreas Rottmann         | Rotty <at> ICQ      | 118634484 <at> ICQ | a.rottmann <at> gmx.at
http://yi.org/rotty      | GnuPG Key: http://yi.org/rotty/gpg.asc
Fingerprint              | DFB4 4EB4 78A4 5EEE 6219  F228 F92F CFC5 01FD 5B62
v2sw7MYChw5pr5OFma7u7Lw2m5g/l7Di6e6t5BSb7en6g3/5HZa2Xs6MSr1/2p7 hackerkey.com

Beware of bugs in the above code; I have only proved it correct,
not tried it.  -- Donald E. Knuth
James Graves | 2 Oct 2005 13:14
Favicon
Gravatar

Problems running Scheffig

I've run into some problems running scheffig.

I was able to compile and install essence and fcc, I believe correctly.

I then edited the scheffig Makefile to point it to the image which
contained essence and fcc.

Running make, I received this error:

Error: No such file or directory
       (&primitive-i/o-error (status . 2) (operation . #{Procedure 2477 (open-input-file in
channel-ports)}) (arguments "default-types-common.scm"))
make: *** [`pwd`/start.image] Error 1

There is no default-types-common.scm in the scheffig directory which I
checked out using darcs.

So I commented out all references to default-types-common that I could
find and was able to recompile it.  There were a couple of warnings in
addition:

Warning: undefined variables
         #{Package 303 default-type-struct-typedef-union}
         extract-function-name-for-type
         enter-function-name-for-type
         (&warning)

Warning: undefined variables
         #{Package 300 default-types}
         structed-name
(Continue reading)

James Graves | 3 Oct 2005 20:59
Favicon
Gravatar

Notes on running Scheffig

I was able to get Scheffig running sucessfully on my own test file.

Here are some notes on that:

After starting up the image containing Scheffig, I was not able to run
procedures scheffig or run-scheffig.  I edited the interfaces.scm file
to include my-scheffig in the export list for scheffig-interface instead
of 't'.

Then I was able to edit scheffig-configuration.scm to use my test files,
and that ran OK.

Here are my test files.  foo.h:

int foo(int x);

and foo.c:

int foo(int x)
{
    return x + 3;
}

I was then able to compile them following the instructions in the
Scheffig and Scheme 48 documentation.

I ended up adding a s48_on_load() procedure to the generated stub_foo.c:

void s48_on_load()
{
(Continue reading)

Michael Sperber | 6 Oct 2005 14:52
Picon

Re: R5RS Collision in Scheme48


Ulrich Hobelmann <u.hobelmann <at> web.de> writes:

> Colliding with section 6.2.5 of the R5RS, Scheme48 doesn't seem to 
> accept multiple arguments to "/".
>
>> (/ 120 5 6)
>
> Warning: invalid arguments
>          (/ 120 5 6)
>          (procedure wants: (:number &opt :number))
>          (arguments are: (:exact-integer :exact-integer :exact-integer))
>          (&warning)
>
> Error: wrong number of arguments
>        ('#{Procedure 90 /} 120 5 6)
>
> R5RS says the result of (/ 3 4 5) should be 3/20, for instance.

R5RS actually lists n-ary / as an "optional procedure."  This will
probably become moot once R6RS is out.

--

-- 
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla

Michael Sperber | 6 Oct 2005 19:41
Picon

Re: `trace' and module procedures


Sorry for the late reply.  The aftermath of ICFP has been taking its
toll ...

Emilio Lopes <eclig <at> gmx.net> writes:

> And here is the problem.  Note the new Location of the procedure `foo'.
> Switching tracing on for the procedure `foo' created a binding for it
> in the current package!  Shouldn't it change the binding in the
> package bar?  Is this intentional?

I believe so---I often make use of this feature, anyway.

I usually want to trace calls to a procedure made *from* a specific
package, rather than all of them.  You can always trace at the origin
by saying

,in bar ,trace foo

--

-- 
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla

Andreas Rottmann | 7 Oct 2005 12:38
Picon
Picon
Gravatar

Porting SUnet to s48; network API convergance

The following message is a courtesy copy of an article
that has been posted to gmane.lisp.scheme.scsh.devel as well.

Hi!

Since I'd like to be able to run SUnet on Scheme48, I have wondered
what the best way would be to achive this; here are excerpts of my
exchange with Michael Sperber:

,----
| Andreas Rottmann <ar <at> visotech.at> writes:
|
| > [...] These ideas and patches are all somewhat related to the effort
| > of porting scsh to Scheme48. I'm also interested in details on that,
| > since I want to have SUnet available for Scheme48 and that would
| > mean porting some scsh libraries/infrastructure. Could you please
| > point me to information on the porting process, so I can get
| > involved?
| 
| That's a handful of questions.  I'm not sure I can answer all of them
| well:
| 
| The general plan with scsh and Scheme 48 is to clean up the scsh APIs
| one by one.  The network API is high on that list, and indeed running
| SUnet on Scheme 48 is among our plans.  For that to happen, what we
| need to do is overhaul the scsh networking API---to clean it up, and
| to fit better with Scheme 48 conventions.  First and foremost, that
| means turning the enumerations into finite types, I think.  The best
| way to do it is probably to make the changes on the scsh trunk, and,
| when the code is ready there, merge it over.  (We also have plans to
(Continue reading)

Michael Sperber | 7 Oct 2005 20:30
Picon

Re: `trace' and module procedures


Emilio Lopes <eclig <at> gmx.net> writes:

> It would be nevertheless convenient in such cases if: [...]
>
>  * `untrace' removed the local binding.

It does---or is there a misunderstanding?

--

-- 
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla

Emilio Lopes | 7 Oct 2005 20:30
Picon

Re: `trace' and module procedures

Michael Sperber writes:

> Emilio Lopes <eclig <at> gmx.net> writes:

>> And here is the problem.  Note the new Location of the
>> procedure `foo'.  Switching tracing on for the procedure `foo'
>> created a binding for it in the current package!  Shouldn't it
>> change the binding in the package bar?  Is this intentional?

> I believe so---I often make use of this feature, anyway.

> I usually want to trace calls to a procedure made *from* a specific
> package, rather than all of them.

that's smart and indeed very useful.  I knew I was missing something
here...

It would be nevertheless convenient in such cases if:

 * `trace' issued a warning stating that it's about to shadow the binding
   of procedure `foo' from package `bar'.

 * `untrace' removed the local binding.

What do you think?

Emilio Lopes | 9 Oct 2005 09:40
Picon

Re: `trace' and module procedures

Michael Sperber writes:

> Emilio Lopes <eclig <at> gmx.net> writes:

>> It would be nevertheless convenient in such cases if: [...]
>>
>> * `untrace' removed the local binding.

> It does---or is there a misunderstanding?

I mean this:

   Welcome to Scheme 48 1.3 (made by root on Mon Aug  1 20:34:22 CEST 2005)
   Copyright (c) 1993-2005 by Richard Kelsey and Jonathan Rees.
   Please report bugs to scheme-48-bugs <at> s48.org.
   Get more information at http://www.s48.org/.
   Type ,? (comma question-mark) for help.
   > ,new-package
   225> (define (foo x) (+ x x))
   ; no values returned
   225> ,structure bar (export foo)
   bar> ,user
   > ,open bar
   > ,bound? foo
   Bound to #(#{Type :value #f #f} #{Location 6061 foo bar} #f)
   > (foo 21)
   42
   > ,trace foo
   > ,bound? foo
   Bound to #((variable #{Type :value #f #f}) #{Location 6063 foo user} #f)
(Continue reading)

Michael Sperber | 10 Oct 2005 19:48
Picon

Re: `trace' and module procedures

Emilio Lopes <eclig <at> gmx.net> writes:

> Michael Sperber writes:
>
>> Emilio Lopes <eclig <at> gmx.net> writes:
>
>>> It would be nevertheless convenient in such cases if: [...]
>>>
>>> * `untrace' removed the local binding.
>
>> It does---or is there a misunderstanding?
>
> I mean this:
>
>    Welcome to Scheme 48 1.3 (made by root on Mon Aug  1 20:34:22 CEST 2005)
>    Copyright (c) 1993-2005 by Richard Kelsey and Jonathan Rees.
>    Please report bugs to scheme-48-bugs <at> s48.org.
>    Get more information at http://www.s48.org/.
>    Type ,? (comma question-mark) for help.
>    > ,new-package
>    225> (define (foo x) (+ x x))
>    ; no values returned
>    225> ,structure bar (export foo)
>    bar> ,user
>    > ,open bar
>    > ,bound? foo
>    Bound to #(#{Type :value #f #f} #{Location 6061 foo bar} #f)
>    > (foo 21)
>    42
>    > ,trace foo
(Continue reading)


Gmane