Re: [racket-users] strange behaviour of procedure partitions

2017-11-12 Thread Gustavo Massaccesi
I can reproduce this error in
Welcome to DrRacket, version 6.11 [3m].
Language: racket [custom]; memory limit: 2048 MB.

but only if I use this configuration:

[X] No debugging or profiling

[   ] Populate compiled directories (I didn't try enabling this)
[??] Preserve stacktrace (error with or without this option)
[X] Enforce constant definitions

Gustavo



On Sun, Nov 12, 2017 at 6:57 PM, Jos Koot  wrote:
> I have downloaded and installed "Welcome to DrRacket, version
> 6.11.0.2--2017-11-12(b54ea8c5b1/a) [3m].",
> but the problem still remains.
> I have Windows 7 premium home.
> Thanks, Jos
>
> 
> From: Jens Axel Søgaard [mailto:jensa...@soegaard.net]
> Sent: zondag 12 november 2017 21:21
> To: Jos Koot; Racket Users
> Subject: Re: [racket-users] strange behaviour of procedure partitions
>
>
> søn. 12. nov. 2017 kl. 19.54 skrev Jos Koot :
>>
>> Hi
>>
>> In the definitions window of DrRacket:
>>
>> #lang racket
>> (require (only-in math/number-theory partitions))
>> (partitions 0)
>> (partitions 0)
>>
>> Runs ok,
>> but after running,
>> typing (partitions 0) in the interactions window
>> gives the following error:
>>
>> define-values: assignment disallowed;
>>  cannot re-define a constant
>>   constant: lifted.0
>
>
> Have you tried it in a version of Racket using the new expander?
>
> Just a hunch based on: https://github.com/racket/datalog/issues/6
>
>
>> The error does not show up when I comment out
>> the two lines (partitions 0) in the definitions window
>> and rerun before typing (partitions 0) in the interactions window.
>> I suppose this is a bug.
>>
>> The error does not occur when replacing
>> #lang racket
>> by
>> #lang typed/racket
>>
>> It is very well possible that I don't correctly require
>> from a typed module into an untyped one.
>> Should be possible, no?
>>
>> Thanks, Jos
>>
>> --
>> 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.
>
> --
> --
> Jens Axel Søgaard
>
> --
> 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] strange behaviour of procedure partitions

2017-11-12 Thread Jos Koot
I have downloaded and installed "Welcome to DrRacket, version 
6.11.0.2--2017-11-12(b54ea8c5b1/a) [3m].",
but the problem still remains.
I have Windows 7 premium home.
Thanks, Jos

  _  

From: Jens Axel Søgaard [mailto:jensa...@soegaard.net] 
Sent: zondag 12 november 2017 21:21
To: Jos Koot; Racket Users
Subject: Re: [racket-users] strange behaviour of procedure partitions



søn. 12. nov. 2017 kl. 19.54 skrev Jos Koot :




Hi 

In the definitions window of DrRacket: 

#lang racket 
(require (only-in math/number-theory partitions)) 
(partitions 0) 
(partitions 0) 

Runs ok, 
but after running, 
typing (partitions 0) in the interactions window 
gives the following error: 

define-values: assignment disallowed; 
 cannot re-define a constant 
  constant: lifted.0 




Have you tried it in a version of Racket using the new expander?

Just a hunch based on: https://github.com/racket/datalog/issues/6



The error does not show up when I comment out 
the two lines (partitions 0) in the definitions window 
and rerun before typing (partitions 0) in the interactions window. 
I suppose this is a bug. 

The error does not occur when replacing 
#lang racket 
by 
#lang typed/racket 

It is very well possible that I don't correctly require 
from a typed module into an untyped one. 
Should be possible, no? 

Thanks, Jos 



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


-- 

-- 
Jens Axel Søgaard


-- 
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] strange behaviour of procedure partitions

2017-11-12 Thread Jens Axel Søgaard
søn. 12. nov. 2017 kl. 19.54 skrev Jos Koot :

> Hi
>
> In the definitions window of DrRacket:
>
> #lang racket
> (require (only-in math/number-theory partitions))
> (partitions 0)
> (partitions 0)
>
> Runs ok,
> but after running,
> typing (partitions 0) in the interactions window
> gives the following error:
>
> *define-values: assignment disallowed;*
> * cannot re-define a constant*
> *  constant: lifted.0*
>
>
Have you tried it in a version of Racket using the new expander?

Just a hunch based on: https://github.com/racket/datalog/issues/6


The error does not show up when I comment out
> the two lines (partitions 0) in the definitions window
> and rerun before typing (partitions 0) in the interactions window.
> I suppose this is a bug.
>
> The error does not occur when replacing
> #lang racket
> by
> #lang typed/racket
>
> It is very well possible that I don't correctly require
> from a typed module into an untyped one.
> Should be possible, no?
>
> Thanks, Jos
>
> --
> 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.
>
-- 
-- 
Jens Axel Søgaard

-- 
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] strange behaviour of procedure partitions

2017-11-12 Thread Jos Koot
Hi

In the definitions window of DrRacket:

#lang racket
(require (only-in math/number-theory partitions))
(partitions 0)
(partitions 0)

Runs ok,
but after running,
typing (partitions 0) in the interactions window
gives the following error:

define-values: assignment disallowed;
 cannot re-define a constant
  constant: lifted.0

The error does not show up when I comment out
the two lines (partitions 0) in the definitions window
and rerun before typing (partitions 0) in the interactions window.
I suppose this is a bug.

The error does not occur when replacing
#lang racket
by
#lang typed/racket

It is very well possible that I don't correctly require
from a typed module into an untyped one.
Should be possible, no?

Thanks, Jos

-- 
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-12 Thread Greg Hendershott
People hit this using GUI Emacs on macOS -- and use the
`exec-path-from-shell` Emacs Lisp package:

  https://github.com/purcell/exec-path-from-shell




Ever find that a command works in your shell, but not in Emacs?

This happens a lot on OS X, where an Emacs instance started from the
GUI inherits a default set of environment variables.

This library solves this problem by copying important environment
variables from the user's shell: it works by asking your shell to
print out the variables of interest, then copying them into the Emacs
environment.




The source is <270 lines of Emacs Lisp -- of which >200 is comments
and boilerplate.

Maybe someone could make an equivalent DrRacket plugin and provide it
as a Racket package?

-- 
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] catching a contract violation in a unit test with check-exn

2017-11-12 Thread Tim Hanson
hi,

As part of something I'm working on I want to convert a stream of values 
into a stream of pairs of values, e.g.

  1 2 3 4

becomes
  (1 2) (3 4)

The following seems to work fine:

(define (pairwise-stream astream)
  (if (stream-empty? astream)
  empty-stream
  (stream-cons
   (cons
(stream-first astream)
(stream-first (stream-rest astream)))
   (pairwise-stream
(stream-rest (stream-rest astream))

but I'd like my 2nd or 3rd test to detect a problem with a stream of odd 
length and haven't figured out how yet. Here's my attempt (lengths 0 and 2 
work fine, length 1 shows a contract violation, but my test doesn't detect 
it):

(check-equal?
 (stream->list
  (pairwise-stream empty-stream))
 (stream->list empty-stream))

; hmmm, how to detect this correctly?
;(check-exn
; exn:fail:contract?
; (stream-first
;  (pairwise-stream (stream-cons 1 empty-stream

(check-equal?
 (stream->list (pairwise-stream (stream-cons 1 (stream-cons 2 
empty-stream
 (stream->list (stream-cons (cons 1 2) empty-stream)))

I'd be grateful for advice.

Cheers,

Tim

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