Re: [racket-users] match in Lazy Racket?

2017-12-08 Thread Sam Tobin-Hochstadt
The bindings provided by `#lang lazy` aren't precisely spelled out,
but the documentation says: "The language provides bindings that are
equivalent to most of the racket/base and racket/list libraries."
`match` isn't in `racket/base`, so you'll need to require it, just
like if you started with `#lang racket/base`.

Sam

On Fri, Dec 8, 2017 at 5:13 PM, Zelphir Kaltstahl
 wrote:
> Thank you for this quick and easy solution, this help!
>
> I am still curious however, why it is in such a way, that so many other
> forms are available, but `match` must be required. I could imagine that
> `match` is a complex thing under the covers, but I am not sure whether that
> is the reason or something else.
>
> Or maybe there is even a general reason for multiple forms not being
> available in Lazy Racket?
> If there is no general reason, maybe we can create a list of not available
> ones and put it in the Lazy Racket docs, including ways, if there are any,
> to get the forms available when using Lazy Racket.
>
> On Friday, December 8, 2017 at 10:29:02 PM UTC+1, Ben Greenman wrote:
>>
>> You can `(require racket/match)`. Make sure to force the match expression!
>>
>> #lang lazy
>> (require racket/match)
>>
>> (match (! (string->symbol "a"))
>>   ['a 'a]
>>   ['b 'b])
>
> --
> 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] Weird problem with bytes-utf-8-length

2017-12-08 Thread Jonathan Simpson
That seems to work. Thank you for the rapid response!

I feel so much better now that 1 + 1 = 2 again :)

-- Jonathan

On Friday, December 8, 2017 at 7:07:26 PM UTC-5, Matthew Flatt wrote:
>
> This is a bug in the optimizer. The `bytes-utf-8-length` function is 
> incorrectly marked as always returning a fixnum. I'll push a repair. 
>
> Meanwhile, to work around the bug, use something like this: 
>
>  (define non-broken-bytes-utf-8-length bytes-utf-8-length) 
>  ;; To confuse and work around the optimizer: 
>  (set! non-broken-bytes-utf-8-length non-broken-bytes-utf-8-length) 
>
>
> At Fri, 8 Dec 2017 15:58:32 -0800 (PST), Jonathan Simpson wrote: 
> > Welcome to DrRacket, version 6.11 [3m]. 
> > Language: racket, with debugging; memory limit: 128 MB. 
> > > (if (bytes-utf-8-length (bytes 255)) 1 2) 
> > 1 
> > > (bytes-utf-8-length (bytes 255)) 
> > #f 
> > > (not (bytes-utf-8-length (bytes 255))) 
> > #f 
> > 
> > Can anyone explain this to me? Surely the output of the last line should 
> be 
> > #t. Is it a bug? 
> > 
> > It happens with both 6.11 and 6.3. I know there must be a rational 
> > explanation, so please enlighten me! 
> > 
> > Thanks, 
> > Jonathan 
>
>

-- 
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] Weird problem with bytes-utf-8-length

2017-12-08 Thread Matthew Flatt
This is a bug in the optimizer. The `bytes-utf-8-length` function is
incorrectly marked as always returning a fixnum. I'll push a repair.

Meanwhile, to work around the bug, use something like this:

 (define non-broken-bytes-utf-8-length bytes-utf-8-length)
 ;; To confuse and work around the optimizer:
 (set! non-broken-bytes-utf-8-length non-broken-bytes-utf-8-length)


At Fri, 8 Dec 2017 15:58:32 -0800 (PST), Jonathan Simpson wrote:
> Welcome to DrRacket, version 6.11 [3m].
> Language: racket, with debugging; memory limit: 128 MB.
> > (if (bytes-utf-8-length (bytes 255)) 1 2)
> 1
> > (bytes-utf-8-length (bytes 255))
> #f
> > (not (bytes-utf-8-length (bytes 255)))
> #f
> 
> Can anyone explain this to me? Surely the output of the last line should be 
> #t. Is it a bug? 
> 
> It happens with both 6.11 and 6.3. I know there must be a rational 
> explanation, so please enlighten me!
> 
> Thanks,
> Jonathan

-- 
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] Weird problem with bytes-utf-8-length

2017-12-08 Thread Jonathan Simpson
Welcome to DrRacket, version 6.11 [3m].
Language: racket, with debugging; memory limit: 128 MB.
> (if (bytes-utf-8-length (bytes 255)) 1 2)
1
> (bytes-utf-8-length (bytes 255))
#f
> (not (bytes-utf-8-length (bytes 255)))
#f

Can anyone explain this to me? Surely the output of the last line should be 
#t. Is it a bug? 

It happens with both 6.11 and 6.3. I know there must be a rational 
explanation, so please enlighten me!

Thanks,
Jonathan

-- 
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: Typed Racket has lowered my performance

2017-12-08 Thread HiPhish
No, I did the same thing, and only the first hundred tests work normally, 
the other 100 hand for several minutes. Maybe my computer is too weak, it's 
an early 2009 iMac with a 2.66GHz Core2Duo and 8GB of RAM. I also ran `raco 
setup msgpack` after making the change to the source file to make sure 
everything gets compiled properly.

On Monday, December 4, 2017 at 11:59:10 PM UTC+1, Sam Tobin-Hochstadt wrote:
>
> I'm not able to replicate that (see transcript below). Is there 
> something else I should be doing? 
>

-- 
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] match in Lazy Racket?

2017-12-08 Thread Zelphir Kaltstahl
Thank you for this quick and easy solution, this help!

I am still curious however, why it is in such a way, that so many other 
forms are available, but `match` must be required. I could imagine that 
`match` is a complex thing under the covers, but I am not sure whether that 
is the reason or something else.

Or maybe there is even a general reason for multiple forms not being 
available in Lazy Racket?
If there is no general reason, maybe we can create a list of not available 
ones and put it in the Lazy Racket docs, including ways, if there are any, 
to get the forms available when using Lazy Racket.

On Friday, December 8, 2017 at 10:29:02 PM UTC+1, Ben Greenman wrote:
>
> You can `(require racket/match)`. Make sure to force the match expression! 
>
> #lang lazy 
> (require racket/match) 
>
> (match (! (string->symbol "a")) 
>   ['a 'a] 
>   ['b 'b]) 
>

-- 
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] match in Lazy Racket?

2017-12-08 Thread Ben Greenman
You can `(require racket/match)`. Make sure to force the match expression!

#lang lazy
(require racket/match)

(match (! (string->symbol "a"))
  ['a 'a]
  ['b 'b])

-- 
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] match in Lazy Racket?

2017-12-08 Thread Zelphir Kaltstahl
I played a bit with lazy Racket and when I used `match`:

~~~
#lang lazy

(match 'a
  ['a 'a]
  ['b 'b])
~~~

In Emacs in racket-mode the `match` was underlined and I was told that:

~~~
match: unbound identifier in module
~~~

Is there truly no match possible in lazy Racket? What is the reasoning 
behind this?

-- 
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] Correction: BOB is on Feb 23! [WAS: Call for Participation: BOB 2018 (February 28, Berlin)]

2017-12-08 Thread Michael Sperber

SSIA ... sorry about that!

-- 
Regards,
Mike

-- 
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] DrRackGit & LibGit2

2017-12-08 Thread Stephen De Gabrielle
HI John,

Thanks for taking the time to look at this - anytime you have is
appreciated.

As I'm not familiar with FFI and I'm not clear what the benefits over git
that lib2git brings on Windows/Linux/Macos I was honestly considering
leaving 'as-is' libgit2 and adding using git as an option in DrRackGit (via
racket/system) on the grounds that users will have git installed anyway.
(I'm pretty sure 'Github desktop' uses git, though it might have changed to
libgit2 in an update)

If you feel FFI/Libgit2 is worth the effort I'll follow you lead - please
don't hesitate to give me any task that will help.

> I definitely don’t have any time before next Tuesday.
Not a problem - I'm enthusiastic but DrRacket isn't my day job either. 😁

Thanks again,

Stephen

---
Welcome to DrRacket, version 6.11 [3m].
Language: racket, with debugging; memory limit: 128 MB.
#
1

repository > libgit2 > git repo path
. FAILURE
name:   check-equal?
location:   test-libgit2.rkt:100:16
actual:
#
expected:
#


config > libgit2 > open level
. ERROR

git_config_open_level: contract violation
  expected: 0
  received: "7: no config file exists for the given level '1'"

45 success(es) 1 failure(s) 1 error(s) 47 test(s) run
2
>


On Thu, Dec 7, 2017 at 10:57 PM, John Clements 
wrote:

>
>
> > On Dec 7, 2017, at 2:34 PM, Stephen De Gabrielle <
> spdegabrie...@gmail.com> wrote:
> >
> > I should be clear, I ran the libgit2 tests by hard coding the location
> of the library and running them manually. I don’t really know what I’m
> doing so that was the best I could muddle through.
>
> That doesn’t sound ideal. Probably it’s better to deliver the library with
> the package on macos & windows, & ask user to install using package manager
> on linux. Sounds like entertaining work, and I’ve been meaning to take a
> look at this for quite a while now, but I definitely don’t have any time
> before next Tuesday.
>
> John
>
> > S.
> >
> > On Thu, 7 Dec 2017 at 22:28, Stephen De Gabrielle <
> spdegabrie...@gmail.com> wrote:
> > Only on macOS, but most tests passed.
> > S.
> > On Thu, 7 Dec 2017 at 22:15, John Clements 
> wrote:
> > Bradley was a student of mine, so I’m interested generally. Have you
> checked to see whether adding the libgit2 dependency allows the tests to
> pass?
> >
> > John
> >
> > > On Dec 7, 2017, at 10:27 AM, Stephen De Gabrielle <
> spdegabrie...@gmail.com> wrote:
> > >
> > >
> > > Hi,
> > > https://pkgs.racket-lang.org/package/Drrackgit
> > > https://github.com/bbusching/drrackgit
> > > https://pkgs.racket-lang.org/package/libgit2
> > > https://github.com/bbusching/libgit2
> > > https://libgit2.github.com/
> > >
> > > I was very excited when I found the DrRackGit tool in the Racket
> packages, but saddened to find it is currently failing.
> > >
> > > Bradley, the original developer was kind enough to diagnose the issue
> ( it is missing the dependency on the libgit2 library.) and add a
> compatible licence, but isn’t able to maintain it at the moment.
> > >
> > > Is anyone interested in fixing the libgit2 package?
> > >
> > > Kind regards,
> > >
> > > Stephen
> > >
> > > PS I have built the lib2git library on macOS, but I lack the required
> experience in FFI and I can’t currently build for Linux or windows.
> > >
> > >
> > >
> > >
> > >
> > >
> > > --
> > > Kind regards,
> > > Stephen
> > > --
> > > Ealing (London), UK
> > >
> > > --
> > > 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.
> >
> >
> >
> > --
> > Kind regards,
> > Stephen
> > --
> > Ealing (London), UK
> > --
> > Kind regards,
> > Stephen
> > --
> > Ealing (London), UK
>
>
>
>

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