Robby Findler | 1 Jul 01:33 2004

Re: naming convention for structure constructor vs. wrapper?

  For list-related administrative tasks:
  http://list.cs.brown.edu/mailman/listinfo/plt-scheme

I usually use build-XXX in that case (esp. when it is a procedure).

Robby

At Wed, 30 Jun 2004 18:45:04 -0400, Doug Orleans wrote:
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> 
> I often find myself defining a wrapper around a structure constructor,
> either a procedure that takes a different number of arguments (e.g. to
> provide default values) or a macro that provides some syntactic sugar
> for construction (or both).  I want to provide both the wrapper and
> the underlying constructor, so I have to come up with a new name for
> one or the other.  Is there a naming convention for this pattern?
> I've been renaming the `make-foo' constructor to `make-foo*' and then
> naming the wrapper `make-foo', but I'm thinking this is an abuse of
> the `*' convention (which is already somewhat abused: in the case of
> `let*' or `send*' it implies serial repetition, whereas in
> `syntax-case*' and `class*' it implies extra arguments).  I was
> thinking of using `foo' for the wrapper if it's a macro (and keeping
> `make-foo' as the constructor procedure), similar to `generic'
> vs. `make-generic', but then this clashes with the syntax binding
> produced by `define-struct', which I want to keep so that users can
> define subtypes (or use match, etc).  Any other ideas?
> 
> --dougo@...

(Continue reading)

Matthias Felleisen | 1 Jul 04:32 2004

Re: naming convention for structure constructor vs. wrapper?

  For list-related administrative tasks:
  http://list.cs.brown.edu/mailman/listinfo/plt-scheme

Why not use a module or a unit to re-export
the thing with the right name: make-foo

(module foo mzscheme

   (define-struct foo (i))

   (define (create-foo i)
     (if (number? i) (make-foo i) (error))

   (provide (rename create-foo make-foo)))

Or do it as a macro. Look at Chez's define-structure, too.

-- Matthias

On Jun 30, 2004, at 7:33 PM, Robby Findler wrote:

>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
> I usually use build-XXX in that case (esp. when it is a procedure).
>
> Robby
>
> At Wed, 30 Jun 2004 18:45:04 -0400, Doug Orleans wrote:
>>   For list-related administrative tasks:
(Continue reading)

Robby Findler | 1 Jul 04:37 2004

Re: naming convention for structure constructor vs. wrapper?

  For list-related administrative tasks:
  http://list.cs.brown.edu/mailman/listinfo/plt-scheme

Because the name "make-" might make people think it actually was a 
maker.

Robby

On Jun 30, 2004, at 9:32 PM, Matthias Felleisen wrote:

> Why not use a module or a unit to re-export
> the thing with the right name: make-foo
>
> (module foo mzscheme
>
>   (define-struct foo (i))
>
>   (define (create-foo i)
>     (if (number? i) (make-foo i) (error))
>
>   (provide (rename create-foo make-foo)))
>
> Or do it as a macro. Look at Chez's define-structure, too.
>
> -- Matthias
>
>
> On Jun 30, 2004, at 7:33 PM, Robby Findler wrote:
>
>>   For list-related administrative tasks:
(Continue reading)

Doug Orleans | 1 Jul 05:15 2004
X-Face

Re: naming convention for structure constructor vs. wrapper?

  For list-related administrative tasks:
  http://list.cs.brown.edu/mailman/listinfo/plt-scheme

Matthias Felleisen writes:
 > Why not use a module or a unit to re-export
 > the thing with the right name: make-foo

Because there's already a make-foo, and I want to export both of them.
Sorry, I thought I made that clear.

--dougo@...

Arend P. van der Veen | 1 Jul 14:16 2004
Picon
Picon

Servlet Timeouts

  For list-related administrative tasks:
  http://list.cs.brown.edu/mailman/listinfo/plt-scheme

Hi,

I have been attempting to test the servlet timeout feature to confirm 
that the system reclaims continuations used by a servlet.  To perform 
this test I wrote a function (in Python) on another machine that 
accessed the add.ss example servlet.  The function submits the first 
number but never submits the second number.  I call this function 40,000 
times.  According to my web server configuration file I would expect 
that the servlet should time out in two minutes (default servlet timeout 
= 120 seconds).   After I completed my test the web server process has 
consumed about 152 MB of RAM.     I think that the memory consumption 
has stabilized even if I rerun the test (and not restart the web 
server).  Also, it takes much more then 2 minutes for my python client 
to access the server 40,000 times.

1.   I was originally having problems with the add servlet leaking 
memory.  I included a send/finish at the end of the unit.  My new add.ss 
is at the end of this post.  Am I correct in assuming that this servlet 
should not leak memory now ?

2.   Do the log files contain any information indicating that a servlet 
has timeout ?  I was not able to find any indications.

3.   When the servlet times out should all the RAM associated with the 
servlet be automatically released ?

Thanks in advance for your help.
(Continue reading)

Noel Welsh | 1 Jul 15:18 2004
Picon

ANN: Client side cookie code

  For list-related administrative tasks:
  http://list.cs.brown.edu/mailman/listinfo/plt-scheme

I have just released some code for client side cookie
management. It provides:

  - a representation for RFC 2109 and Netscape cookies

  - functions to parse cookies from HTTP headers

  - a cookie-jar to manage received cookies

  - functions to turn cookies into strings suitable for a
  Cookie HTTP header

  - miscellaneous other procedures

There are some outstanding issues with the package, but it
should be good enough for small scale applications.  It has
been released now, when it still have some problems, to
give
others access to the code as early as possible.  Future
releases will fix these problems and add additional
functionality.

The code is the cookie 0.1 release at Schematics:

  http://schematics.sourceforge.net/

Enjoy!
(Continue reading)

Eli Barzilay | 1 Jul 16:27 2004

Re: naming convention for structure constructor vs. wrapper?

  For list-related administrative tasks:
  http://list.cs.brown.edu/mailman/listinfo/plt-scheme

On Jun 30, Robby Findler wrote:
> 
> I usually use build-XXX in that case (esp. when it is a procedure).

FWIW, I'm with Doug -- I don't like using a different name when there
are slots that should be not be visible for constructors, common cases
that I can think of are cache slots, and constructors that need to do
some extra work for initialization.  If I need to provide the raw
constructor I do the same make-foo* thing (I consider "*" as similar
to ML's "'", so I don't mind overloading its meaning).

--

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!

Michael Sperber | 1 Jul 19:37 2004
Picon

Re: naming convention for structure constructor vs. wrapper?

  For list-related administrative tasks:
  http://list.cs.brown.edu/mailman/listinfo/plt-scheme

>>>>> "Doug" == Doug Orleans <dougo@...> writes:

Doug> I was thinking of using `foo' for the wrapper if it's a macro
Doug> (and keeping `make-foo' as the constructor procedure), similar
Doug> to `generic' vs. `make-generic', but then this clashes with the
Doug> syntax binding produced by `define-struct', which I want to keep
Doug> so that users can define subtypes (or use match, etc).  Any
Doug> other ideas?

Use SRFI 9, where you can pick the name of the constructor.  I usually
choose REALLY-MAKE-xxx for the real constructor, and MAKE-xxx for the
wrapper.  DEFINE-STRUCT sucks.

--

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

Matthias Felleisen | 1 Jul 19:50 2004

Re: naming convention for structure constructor vs. wrapper?

  For list-related administrative tasks:
  http://list.cs.brown.edu/mailman/listinfo/plt-scheme

 From the manual:

(define-values (struct:a really-make-a a? a-ref a-set!)
   (make-struct-type 'a #f 2 1 'uninitialized))
(define an-a (really-make-a 'x 'y))
(a-ref an-a 1) ; => 'y
(a-ref an-a 2) ; => 'uninitialized

(define (make-a x y) (really-make-a (symbol> x) (symbol> y)))
(define (symbol> x) (if (symbol? x) x (error 'symbol>)))

(define a-first (make-struct-field-accessor a-ref 0))
(a-first an-a) ; => 'x

(a-first (make-a 'a 'b))

With a few slight enhancements. make-struct-type is the real thing.

-- Matthias

On Jul 1, 2004, at 1:37 PM, Michael Sperber wrote:

>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
>>>>>> "Doug" == Doug Orleans <dougo@...> writes:
>
(Continue reading)

Greg Pettyjohn | 1 Jul 20:30 2004

Re: Servlet Timeouts

  For list-related administrative tasks:
  http://list.cs.brown.edu/mailman/listinfo/plt-scheme

There is a servlet timeout test as part of the servlet test suite.
I will be improving these tests in the next week or so.

Pete Hopkins, a student at Brown, has also done a series of stress 
tests which characterize the server's
resource usage with respect to continuations.

We have identified a few problems with managing the lifetimes of 
continuations and
will be providing a solution in  some future version of the server.

Although this is a research project that we are currently aggressively 
pursuing, we
are still only a few weeks into it and I don't yet have a prediction as 
to when a solution will
be available.

On Jul 1, 2004, at 8:16 AM, Arend P. van der Veen wrote:

>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
> Hi,
>
> I have been attempting to test the servlet timeout feature to confirm 
> that the system reclaims continuations used by a servlet.  To perform 
> this test I wrote a function (in Python) on another machine that 
(Continue reading)


Gmane