Re: [racket-users] Re: Racket in command line, puts out wrong number

2017-11-09 Thread Alex Harsanyi
Hi Karim,

You forgot to add the racket users list to your message, so your reply
is sent to the mailing list. I fixed that.

On Fri, Nov 10, 2017 at 12:17 AM, Karim Djemai
 wrote:
> Hey Alex,
> thank you for your quick response!
> Is there any way for me to get the eulers number, starting with 27...,
> displayed in racket?

As I explain it, the number is the same in both Racket and DrRacket,
they are just displayed differently.

You can obtain the closest integer using the `floor` function and the
remaining rational part by subtracting the integer part from your
number.  Like so:

(define e (* (power 10 1001) (euler)))
(floor e)   ; returns integer part
beginning with "271..."
(- e (floor e))   ; returns the remaining
fractional part

Best Regards,
Alex.

-- 
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] numerical partitions

2017-11-09 Thread Iain Gray
many thanks to all
Iain

> On 9 Nov 2017, at 17:50, Jos Koot  wrote:
> 
> I have put my code at: https://github.com/joskoot/partitions 
> Best wishes, Jos
> 
> -Original Message-
> From: Iain Gray [mailto:iaing...@ednet.co.uk] 
> Sent: jueves, 09 de noviembre de 2017 17:30
> To: Jos Koot
> Cc: Racket Users
> Subject: Re: [racket-users] numerical partitions
> 
> my use will be a rhythmic pattern generator macro within the Common Music 
> package. Sorry I lost the original implementation when my
> computer crashed last year, Iain
> 
>> On 9 Nov 2017, at 13:28, Jos Koot  wrote:
>> 
>> How did you implement procedure part many years ago?
>> Things may depend on what you want to do with the partitions.
>> Do you want the whole list at once,
>> or would a stream or generator be more appropriate?
>> If you want I can send you a stream-version,
>> but it is in a bad style.
>> It has docs made with scribble.
>> Jos
>> 
>> -Original Message-
>> From: racket-users@googlegroups.com [mailto:racket-users@googlegroups.com] 
>> On Behalf Of Iain Gray
>> Sent: jueves, 09 de noviembre de 2017 11:17
>> To: Racket Users
>> Subject: [racket-users] numerical partitions
>> 
>> Many years ago (r5rs days) I asked for help in partitioning numbers i.e.
>> 
>> (part 4) returns ((4) (3 1)  (2 2) (2 1 1) (1 1 1 1))
>> 
>> where the order of solutions is not important. Is it more efficient to 
>> implement using Racket's iteration macros? Any help would
> be
>> appreciated.
>> 
>> Iain
>> 
>> -- 
>> 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.

-- 
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] numerical partitions

2017-11-09 Thread Jos Koot
I have put my code at: https://github.com/joskoot/partitions 
Best wishes, Jos

-Original Message-
From: Iain Gray [mailto:iaing...@ednet.co.uk] 
Sent: jueves, 09 de noviembre de 2017 17:30
To: Jos Koot
Cc: Racket Users
Subject: Re: [racket-users] numerical partitions

my use will be a rhythmic pattern generator macro within the Common Music 
package. Sorry I lost the original implementation when my
computer crashed last year, Iain

> On 9 Nov 2017, at 13:28, Jos Koot  wrote:
> 
> How did you implement procedure part many years ago?
> Things may depend on what you want to do with the partitions.
> Do you want the whole list at once,
> or would a stream or generator be more appropriate?
> If you want I can send you a stream-version,
> but it is in a bad style.
> It has docs made with scribble.
> Jos
> 
> -Original Message-
> From: racket-users@googlegroups.com [mailto:racket-users@googlegroups.com] On 
> Behalf Of Iain Gray
> Sent: jueves, 09 de noviembre de 2017 11:17
> To: Racket Users
> Subject: [racket-users] numerical partitions
> 
> Many years ago (r5rs days) I asked for help in partitioning numbers i.e.
> 
> (part 4) returns ((4) (3 1)  (2 2) (2 1 1) (1 1 1 1))
> 
> where the order of solutions is not important. Is it more efficient to 
> implement using Racket's iteration macros? Any help would
be
> appreciated.
> 
> Iain
> 
> -- 
> 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] where does DrRacket get its environment variables on OS X?

2017-11-09 Thread Matthew Butterick
I see your point. But this technique forfeits any broader compatibility with 
desktop-oriented tools (e.g., file launchers and whatnot)

I did try making an Automator application containing a shell script that simply 
launches DrRacket, and also tried `bash -c ···` (to try to force it to launch 
from inside a login session). But these didn't change the result.

Anyhow, add it to the giant pile of things in the world that are more complex 
than I thought.


> On Nov 8, 2017, at 8:07 PM, John Clements  wrote:
> 
>> On Nov 8, 2017, at 12:42, Robby Findler > > wrote:
>> 
>> How about "env X=Y racket -l- drracket file-to-open-in-drracket.rkt” ?
> 
> +1

-- 
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] numerical partitions

2017-11-09 Thread Iain Gray
my use will be a rhythmic pattern generator macro within the Common Music 
package. Sorry I lost the original implementation when my computer crashed last 
year, Iain

> On 9 Nov 2017, at 13:28, Jos Koot  wrote:
> 
> How did you implement procedure part many years ago?
> Things may depend on what you want to do with the partitions.
> Do you want the whole list at once,
> or would a stream or generator be more appropriate?
> If you want I can send you a stream-version,
> but it is in a bad style.
> It has docs made with scribble.
> Jos
> 
> -Original Message-
> From: racket-users@googlegroups.com [mailto:racket-users@googlegroups.com] On 
> Behalf Of Iain Gray
> Sent: jueves, 09 de noviembre de 2017 11:17
> To: Racket Users
> Subject: [racket-users] numerical partitions
> 
> Many years ago (r5rs days) I asked for help in partitioning numbers i.e.
> 
> (part 4) returns ((4) (3 1)  (2 2) (2 1 1) (1 1 1 1))
> 
> where the order of solutions is not important. Is it more efficient to 
> implement using Racket's iteration macros? Any help would be
> appreciated.
> 
> Iain
> 
> -- 
> 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] numerical partitions

2017-11-09 Thread Jos Koot
How did you implement procedure part many years ago?
Things may depend on what you want to do with the partitions.
Do you want the whole list at once,
or would a stream or generator be more appropriate?
If you want I can send you a stream-version,
but it is in a bad style.
It has docs made with scribble.
Jos

-Original Message-
From: racket-users@googlegroups.com [mailto:racket-users@googlegroups.com] On 
Behalf Of Iain Gray
Sent: jueves, 09 de noviembre de 2017 11:17
To: Racket Users
Subject: [racket-users] numerical partitions

Many years ago (r5rs days) I asked for help in partitioning numbers i.e.

(part 4) returns ((4) (3 1)  (2 2) (2 1 1) (1 1 1 1))

where the order of solutions is not important. Is it more efficient to 
implement using Racket's iteration macros? Any help would be
appreciated.

Iain

-- 
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] numerical partitions

2017-11-09 Thread Iain Gray
Many years ago (r5rs days) I asked for help in partitioning numbers i.e.

(part 4) returns ((4) (3 1)  (2 2) (2 1 1) (1 1 1 1))

where the order of solutions is not important. Is it more efficient to 
implement using Racket’s iteration macros? Any help would be appreciated.

Iain

-- 
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] where does DrRacket get its environment variables on OS X?

2017-11-09 Thread Konrad Hinsen

On 08/11/2017 17:48, 'John Clements' via Racket Users wrote:


IIRC, Mac has an apologetic moue towards unix-y things here: I believe there’s 
a special place in your home directory … or maybe it’s in 
~/Library/Preferences, which would …

okay, let me search.

Okay, here you go:

https://stackoverflow.com/questions/135688/setting-environment-variables-in-os-x#588442


That link points to the two good solutions (the one the link points to, 
and the one just after it) for setting global environment variables with 
recent versions of macOS. The second one (lauchctl setenv ...) is often 
the better one, in particular because it can be used on a per-user basis.


It's worth pointing out that macOS has changed its handling of 
environment variables a few times in the past, so you can easily find 
suggestions and recipes that no longer work, or (almost worse) no longer 
work reliably. The best known one of these is modifying 
$HOME/.MacOS/environment.plist, which was the preferred approach in some 
distant past.


If you want the same environment variables in a shell running in a 
terminal and in GUI-based applications, you have to take care in 
configuring both environments in the same way. The obvious approach 
might seem to be not to set environments in the shells at all, letting 
them inherit the global environment, but given that the terminal app 
runs shells as login shells, this doesn't work.


Konrad.

--
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.