[plt-scheme] Examples using date?

From: support at taxupdate.com (support at taxupdate.com)
Date: Tue May 1 12:37:06 EDT 2007

Matthias,

On Tue, May 01, 2007 at 05:26:58PM -0400, Matthias Felleisen wrote:
> (define-struct posn (x y))
> 
> defines six functions
>  make-posn
>  posn?
>  posn-x
>  posn-y
>  set-posn-x!
>  set-posn-y!
> 
> The rest is analogous. -- Matthias
> 
> 
> 
> 
> On May 1, 2007, at 5:23 PM, SpinyNorman wrote:
> 
> >I get, via the HelpDesk, that seconds->date returns me a date struct,
> >which includes various fields, some of which look like what I'm after
> >(day of week, etc.).  The doc appears to assume that it's obvious to
> >the reader what syntax is used to refer to these fields; alas I have
> >no clue.  If I have a date, how do I get at date->week-day, for
> >example?  Apparently there are getter methods associated w/any struct,
> >but I'm not sure what they are.
> >
> >-jmc
> >
> >_________________________________________________
> >  For list-related administrative tasks:
> >  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> 
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> 
> 

When I first started using PLT, this was a stumbling block in understanding
how to use the date struct.  When I finally got around to learning the
struct form, it made sense.  But this was much later in the learning curve
than my first attempts to use 'date'.  A little blurb in section 15.1.1
would be very helpful to newbies.

Wayne


Posted on the users mailing list.