Re: [racket-users] Unable to track down what is requiring inclusion of tzinfo module - Resolved

2016-10-22 Thread Ian Thomas
On Saturday, October 22, 2016 at 2:34:29 PM UTC-4, Jon Zeppieri wrote:
> I changed the tzinfo and tzdata packages to remove the dynamic-require 
> behavior. If tzdata is installed, then tzinfo will use the data and will 
> define a runtime path list referring to the data files, so this should work 
> with `raco exe` now without needing to modify anything. Ian, if you have the 
> time, can you confirm that this works for you?



Jon,

The update worked for me. I had no issue running my application after updating 
the tzinfo package and recompiling my application using raco. Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Funtional programming and the maximum of something

2016-10-22 Thread Daniel Prager
> circle of recursion

I reckon "helix of recursion" would be a more helpful image.

Dan

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Funtional programming and the maximum of something

2016-10-22 Thread Robby Findler
On Sat, Oct 22, 2016 at 3:05 PM,   wrote:
> Robby Findler  [16-10-22 21:28]:
>> You need to follow the design recipe to solve a problem like this. You
>> data is clear: [Listof [Listof Real]] and [Listof Real]. Next up:
>> examples. Do you have examples of the inputs and outputs you want for
>> this function?
>>
>> Robby
>>
>> On Sat, Oct 22, 2016 at 2:03 PM,   wrote:
>> > Hi,
>> >
>> > (I am still a newbie ... )
>> >
>> > If I remember  one rule of functional programming
>> > correctly, it says:
>> > Instead of changeing data - create new data.
>> >
>> > Suppose I have a list of list. Each "sublist" is
>> > made of a greater amount (but identical count) of
>> > exact numbers (integers).
>> >
>> > I want to process these data recursively and if
>> > all is done I want to get back a list of numbers
>> > (same count of numbers as in each sublist), which
>> > represents the maximum of all numbers of that "position"
>> > in all sublists.
>> >
>> > If I want to make this purely (may be inpractical) functional,..
>> > I see (as a newbie) the following problem.
>> > From two numbers as input I have to build a maximum and
>> > have to feed that into the next circle of recursion as
>> > one of the numbers to compare.
>> > Each time a new maximum is found I have to overwrite the
>> > old one.
>> > This contradicts the rule "Dont change data, create new one."
>> >
>> > How can I get out of this?
>> >
>> > Cheers
>> > Meino
>> >
>> >
>> >
>> >
>> > --
>> > You received this message because you are subscribed to the Google Groups 
>> > "Racket Users" group.
>> > To unsubscribe from this group and stop receiving emails from it, send an 
>> > email to racket-users+unsubscr...@googlegroups.com.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to racket-users+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> Hi Robby, hi Phillip, hi Justin,
>
> thanks a lot for your help... !!! :)
> This gives me mind twisters (but this was one reason
> for me to learn racket ;)
>
> So, I think my "knot in the logic" was
> to process one sublist at each circle of recursion
> and being urged to create a temporary maximum with
> each recursion that way, which gets possibly overwritten
> in the next circle with a new temporary maximum.
>
> The 'apply map' creates - as far as I can understand it -
> the maximum from ALL numbers of a certain position of all sublists
> in one go. It creates on ONE maximum and no temporary resuls.
> That's clever :)
>
> Cheers,
> Meino
>
> From the Dictionary of Adanced Programming:
> "Recursion, the: (see "Recursion" )
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Funtional programming and the maximum of something

2016-10-22 Thread Justin Zamora
A clue to the answer is in your statement that you "feed that [maximum]
into the next circle of recursion." Notice that you're not overwriting the
value in the current call, you're creating a new value that you feed into
the new call in the "next circle". So the old one isn't being overwritten
at all.

Justin

On Oct 22, 2016 3:15 PM,  wrote:

> Hi,
>
> (I am still a newbie ... )
>
> If I remember  one rule of functional programming
> correctly, it says:
> Instead of changeing data - create new data.
>
> Suppose I have a list of list. Each "sublist" is
> made of a greater amount (but identical count) of
> exact numbers (integers).
>
> I want to process these data recursively and if
> all is done I want to get back a list of numbers
> (same count of numbers as in each sublist), which
> represents the maximum of all numbers of that "position"
> in all sublists.
>
> If I want to make this purely (may be inpractical) functional,..
> I see (as a newbie) the following problem.
> From two numbers as input I have to build a maximum and
> have to feed that into the next circle of recursion as
> one of the numbers to compare.
> Each time a new maximum is found I have to overwrite the
> old one.
> This contradicts the rule "Dont change data, create new one."
>
> How can I get out of this?
>
> Cheers
> Meino
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Funtional programming and the maximum of something

2016-10-22 Thread Philip McGrath
I'm not sure if I understand what you're tying to do correctly, but here's
one way to do it (or one way to do something, at least):

(define (process-list-of-lists list-of-lists)
  (apply map
(λ args
   (apply max args))
list-of-lists))
(process-list-of-lists
  `((55 1 2)
(8 13 7)
(3 9 42
;; returns '(55 13 42)


Of course, you could also use explicit recursion instead of map and apply,
but you don't "overwrite" the result of a previous recursive call in either
case.

On Sat, Oct 22, 2016 at 2:04 PM  wrote:

> Hi,
>
> (I am still a newbie ... )
>
> If I remember  one rule of functional programming
> correctly, it says:
> Instead of changeing data - create new data.
>
> Suppose I have a list of list. Each "sublist" is
> made of a greater amount (but identical count) of
> exact numbers (integers).
>
> I want to process these data recursively and if
> all is done I want to get back a list of numbers
> (same count of numbers as in each sublist), which
> represents the maximum of all numbers of that "position"
> in all sublists.
>
> If I want to make this purely (may be inpractical) functional,..
> I see (as a newbie) the following problem.
> From two numbers as input I have to build a maximum and
> have to feed that into the next circle of recursion as
> one of the numbers to compare.
> Each time a new maximum is found I have to overwrite the
> old one.
> This contradicts the rule "Dont change data, create new one."
>
> How can I get out of this?
>
> Cheers
> Meino
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Funtional programming and the maximum of something

2016-10-22 Thread Robby Findler
You need to follow the design recipe to solve a problem like this. You
data is clear: [Listof [Listof Real]] and [Listof Real]. Next up:
examples. Do you have examples of the inputs and outputs you want for
this function?

Robby

On Sat, Oct 22, 2016 at 2:03 PM,   wrote:
> Hi,
>
> (I am still a newbie ... )
>
> If I remember  one rule of functional programming
> correctly, it says:
> Instead of changeing data - create new data.
>
> Suppose I have a list of list. Each "sublist" is
> made of a greater amount (but identical count) of
> exact numbers (integers).
>
> I want to process these data recursively and if
> all is done I want to get back a list of numbers
> (same count of numbers as in each sublist), which
> represents the maximum of all numbers of that "position"
> in all sublists.
>
> If I want to make this purely (may be inpractical) functional,..
> I see (as a newbie) the following problem.
> From two numbers as input I have to build a maximum and
> have to feed that into the next circle of recursion as
> one of the numbers to compare.
> Each time a new maximum is found I have to overwrite the
> old one.
> This contradicts the rule "Dont change data, create new one."
>
> How can I get out of this?
>
> Cheers
> Meino
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Funtional programming and the maximum of something

2016-10-22 Thread Meino . Cramer
Hi,

(I am still a newbie ... )

If I remember  one rule of functional programming
correctly, it says: 
Instead of changeing data - create new data.

Suppose I have a list of list. Each "sublist" is 
made of a greater amount (but identical count) of 
exact numbers (integers).

I want to process these data recursively and if
all is done I want to get back a list of numbers
(same count of numbers as in each sublist), which
represents the maximum of all numbers of that "position"
in all sublists.

If I want to make this purely (may be inpractical) functional,..
I see (as a newbie) the following problem.
>From two numbers as input I have to build a maximum and
have to feed that into the next circle of recursion as
one of the numbers to compare.
Each time a new maximum is found I have to overwrite the
old one.
This contradicts the rule "Dont change data, create new one."

How can I get out of this?

Cheers
Meino




-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Unable to track down what is requiring inclusion of tzinfo module - Resolved

2016-10-22 Thread Jon Zeppieri
I changed the tzinfo and tzdata packages to remove the dynamic-require
behavior. If tzdata is installed, then tzinfo will use the data and will
define a runtime path list referring to the data files, so this should work
with `raco exe` now without needing to modify anything. Ian, if you have
the time, can you confirm that this works for you?

(Of course, if you're not on Windows, you won't need the tzdata package,
but the previous way that the code tried to use it would break with `raco
exe` regardless of what system you use.)

- Jon



On Fri, Oct 21, 2016 at 3:50 PM, Jon Zeppieri  wrote:

> This connects to a similar issue I was having with my reorganization of
> the CLDR libraries (which I'm getting back into): https://groups.google.c
> om/d/msg/racket-dev/MrmxvvKidj8/ASEF22_lBQAJ.
>
> It looks like, in the present case, I should do something like this:
>
>
> - The tzdata package includes, in its info.rkt:
>
> (define tzdata-data-files )
>
> I suppose each of the paths should have the form (list 'lib
> "tzinfo/private/data/<...>"), based on the current directory structure of
> the tzdata package.
>
> - The tzinfo code then does something like:
>
> (define-runtime-path-list tzdata-paths
>   (match (find-relevant-directories '(tzdata-data-files))
> [(cons dir _)
>   ((get-info/full dir) 'tzdata-data-files)]
> [_ #f]))
>
> Does that sound right?
>
> - Jon
>
>
>
>
> On Fri, Oct 14, 2016 at 12:39 AM, Sam Tobin-Hochstadt <
> sa...@cs.indiana.edu> wrote:
>
>> That's likely the problem. Usually you need to use define-runtime-path or
>> a variant of that to cooperate with raco exe.
>>
>> Sam
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: opinions on YAML as communication tool

2016-10-22 Thread 'John Clements' via Racket Users

> On Oct 21, 2016, at 14:00, Jack Firth  wrote:
> 
> If you'd still like to use yaml, I would like to quietly point out that each 
> of the following is a valid boolean value in yaml:
> 
> - true
> - false
> - yes
> - no
> - y
> - n
> - True
> - False
> - TRUE
> - FALSE
> - on
> - off
> - YES
> - NO

Yes, that’s pretty much the final nail in the coffin. I’m starting to recognize 
that some of the initial appeal of YAML was due to DWIM that is almost certain 
to later come back to bite me. Looks like I’m stuck with sexps, json, or … 
wait, I could just roll my own parser! Wouldn’t take a second!

…

Just kidding.

Many thanks for the input.

John


-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


Re: [racket-users] opinions on YAML as communication tool

2016-10-22 Thread Stefan Schmiedl
'John Clements' via Racket Users (21.10. 16:32):

> 
> > On Oct 21, 2016, at 12:42 PM, Tony Garnock-Jones  wrote:
> > 
> > You know how Excel guesses whether things are dates or not and messes
> > things up as a consequence? YAML does that too.

YAML does not guess, the processor does. Just like "undefined"
behavior in C, where decisions are left to the compiler. Still,
some people manage to get some use out of it.

> Interesting. I’m trying to wiggle out of your argument, but it’s
> fairly persuasive. Many thanks for your info. Sigh.

If you know what the contents in the file are going to be and that the
processor handles them to your satisfaction, YAML is a convenient
choice. Yes, like whipping up a quick Excel spreadsheet instead of
doing the right thing and separating the data from the evaluation from
the presentation.

---
billing_id: some number
paid: no
address: |
  Company
  Address
  Location
email: some...@some.tld
billing_date: a date
due_date: another date
vat_percent: some number
items:
- title: words
  effort: number of hours
  rate: hourly rate
- title: words
  effort: number of hours
  rate: hourly rate

I've been using this low-ceremony description for invoices for over a
decade and it works reliably with just the right amount of flexibility.

If you want a "natural" looking text-based description of simple data
structures, YAML is not the worst tool to use. Especially if you're
aware of the limitations.

s.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.