Re: [racket-users] New module log-bracketed; should probably be something else

2021-09-23 Thread jackh...@gmail.com
This looks quite a bit like you're trying to implement tracing, which is 
like logging, but instead of emitting messages associated with *points* in 
time, you emit messages for *ranges* of time. Rust has an excellent library 
 for tracing. Perhaps that will 
provide some good inspiration?

On Friday, September 3, 2021 at 8:30:18 AM UTC-7 david@gmail.com wrote:

> On Thu, Sep 2, 2021 at 5:32 PM Sorawee Porncharoenwase <
> sorawe...@gmail.com> wrote:
>
>> Thoughts:
>>
>>- Perhaps the logger should be optional. The default value would be 
>>(current-logger). 
>>- The event name (like on-complete) could also be optional. The 
>>default would be the source location of the macro invocation site 
>>- Instead of “time: ~a”, I think it would be nice to support many 
>>“pairs”, which are formatted like raise-arguments-error. 
>>
>> Example:
>>
>> (define (on-complete x)
>>   (log-test-debug "I'm in on-complete")
>>   x)
>>
>> (with-log ()
>>   1)
>>
>> (with-log (#:logger test-debug
>>#:msg "on-complete"
>>["time" (current-seconds)])
>>   (on-complete (person 'bob)))
>>
>> would output:
>>
>> test: entering test.rkt:5:1
>> test: exiting test.rkt:5:1
>> result: 1
>> 1
>> test: entering on-complete
>> time: 123
>> test: I'm in on-complete
>> test: exiting on-complete
>> time: 124
>> result: (person 'bob)
>> (person 'bob)
>>
>>
>>
> First of all, thank you.  I like the idea of the event name being optional 
> and the logger defaulting but I'm not keen on the syntax.  It's very 
> verbose for something that might occasionally be wrapped around a single 
> line of code. The raise-arguments-error formatting would be a nice default 
> but I prefer to give the option to use a format string if you want 
> something different.
>
>
>> On Thu, Sep 2, 2021 at 2:06 PM Martin DeMello  
>> wrote:
>>
>>> I do like the second form better, especially since the actual code being 
>>> run is not obscured by simply being the last argument to a long log 
>>> function.
>>>
>>
> Cool.  I'll move towards that.
>
>
>>> martin
>>>
>>> On Thu, Sep 2, 2021 at 1:55 PM David Storrs  wrote:
>>>
 I often find that for debugging I want to see a log message saying "I'm 
 about to do X" followed by X followed by "I'm done with X" and I want it 
 to 
 return the result of X.

 I wrote this macro and posted it to the package server:  
 https://pkgs.racket-lang.org/package/log-bracketed

 In retrospect, the syntax is bad and I should change it.  Can anyone 
 suggest something better?

   (define (on-complete x) (log-test-debug "entering on-complete") x)
   (struct person (name) #:transparent)

   (log-bracketed test-debug "on-complete" "time: ~a" (current-seconds) 
 (on-complete (person 'bob)))
   (log-bracketed test-debug "on-complete" "" "no user-specified logging 
 information")

 Spits out:


 test: about to on-complete. time: 1630611613
 test: entering on-complete
 test: after on-complete. time: 1630611613. result: (person 'bob)
 (person 'bob)
 test: about to on-complete
 test: after on-complete. result: "no user-specified logging information"
 "no user-specified logging information"


 The problem is that this looks like it's a simple logging message when 
 in fact it's real code that should not be ignored.  I'm trying to think of 
 a better way to do it...maybe something like this?:

   (with-bracketing-logs ([test-debug "on-complete" "time: ~a" 
 (current-seconds)])

  (on-complete (person 'bob))



 -- 
 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...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/racket-users/CAE8gKocZha-NpiFAAKT1c8QTG3MDFRnvxCD4T0P269EncZW3KQ%40mail.gmail.com
  
 
 .

>>> -- 
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/racket-users/CAFrFfuEqt1NVjE2Ft1JVArvWnKUBvK7jPVoLqPhYCd-dB00A3Q%40mail.gmail.com
>>>  
>>> 
>>> .
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe 

[racket-users] Announcing Fission Flare, a falling block video game

2021-09-23 Thread Ryan Kramer
I've just released v0.1 of a falling block video game: 
https://github.com/default-kramer/fission-flare It draws a lot of 
inspiration from Dr Mario but I don't like to advertise that since my game 
has plenty of unique ideas. And although the patent on Dr Mario has 
expired, I'm not a lawyer and I don't want to invite trouble.

The game is 100% Racket, most of it Typed. The graphics are all done using 
pict. Perhaps I'll start a blog and write up some of the more interesting 
things I learned, but not today. 

Warning - it can be pretty addicting! Well over 90% of my "development" 
time was just me playing the game.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/d4c9e068-a44f-41bd-854a-ee7c286b98fbn%40googlegroups.com.


Re: [racket-users] [ANN] Introducing "social" contracts

2021-09-23 Thread Nathaniel W Griswold
The changes look good, i like the idea of this.

> On Aug 25, 2021, at 10:59 AM, Siddhartha Kasivajhula  
> wrote:
> 
> Hello again folks,
> I recently migrated one of my repos to use social-contract, and thought I'd 
> share the before/after as an example to illustrate what the package does:
> 
> https://github.com/countvajhula/seq/commit/c959be577448640e00ab7015bdaddabb7f8b49ba?branch=c959be577448640e00ab7015bdaddabb7f8b49ba=split

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/ED34FB18-A06C-4CE6-B15B-4680D7B6F3E0%40nan.sh.


[racket-users] Re: Writing to serial port?

2021-09-23 Thread Zeta Convex
Ah, OK. It seems fairly straightforward:

(system "stty -F /dev/ttyACM0 115200 crtscts")

(define out 0)
(set! out (open-output-file "/dev/ttyACM0" #:mode 'binary #:exists 'append))
;(set! in  (open-input-file  port-name #:mode 'binary))
(file-stream-buffer-mode out 'none)
(write-byte whatever out)

(close-output-port out)

On Thursday, 23 September 2021 at 18:31:53 UTC+1 Zeta Convex wrote:

>
> How do I write to a serial port? I'm on Linux, and want a baud rate of 
> 115200.
>
> I'm new to Scheme. I can't seem to find a library to do what I want.
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/2ee59fe3-1543-4fea-80ea-a03cc72aa014n%40googlegroups.com.


[racket-users] Writing to serial port?

2021-09-23 Thread Zeta Convex

How do I write to a serial port? I'm on Linux, and want a baud rate of 
115200.

I'm new to Scheme. I can't seem to find a library to do what I want.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/b9d76bfd-6c40-4f12-b9ad-7cc1947ce047n%40googlegroups.com.


Re: [racket-users] Autumn Lisp Game Jam 2021

2021-09-23 Thread Stephen De Gabrielle
There is a collection of links that may be useful for games at
https://github.com/racket/racket/wiki/Game-Development

And don’t forget 2htdp/universe can be used from #lang racket

Bw
Stephen

On Thu, 23 Sep 2021 at 09:16, Bruce O'Neel  wrote:

>
> This might interest some of you...
>
> Autumn Lisp Game Jam 2021 - itch.io
> 
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/b887503f3a7781fe1681abbaf6e50969%40mail.infomaniak.com
> 
> .
>
-- 


-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAGHj7-%2BuPxb3E6BEUEQT437wPzO32RFSEBT-xhbRz_%3DjYvsDuw%40mail.gmail.com.


[racket-users] Autumn Lisp Game Jam 2021

2021-09-23 Thread Bruce O'Neel
This might interest some of you...

Autumn Lisp Game Jam 2021 - itch.io
[https://itch.io/jam/autumn-lisp-game-jam-2021]

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/b887503f3a7781fe1681abbaf6e50969%40mail.infomaniak.com.