[racket-users] Re: a for/fold #:break question, I think

2022-12-12 Thread tbh...@gmail.com
I haven't asked any questions here for a long time, so hope it's OK to 
cross-post here:
   

   https://racket.discourse.group/

(which I just discovered.)


Cheers,

Tim

On Monday, December 12, 2022 at 10:28:22 PM UTC+1 tbh...@gmail.com wrote:

> hi, I'm trying to do something slightly harder than what the attached 
> example tries to do, but this example suffices to show that I, evidently, 
> am missing something about how for/fold and/or #:break work together. 
>
> (I have used both before, but have gotten out of practice with racket of 
> late and am stuck longer on this than seems reasonable.)
>
> I expect both tests to pass, but both fail (the "j" for jewel in "xxjxx") 
> is seen but not "found", as it were.
>
> I'd be grateful for a bug fix and/or explanation.
>
> Cheers,
>
> Tim Hanson
>
> 
>
> #lang racket
>
> (require rackunit)
>
> (define (port->char-stream aport)
>   (printf "(port->char-stream aport)~n")
>   (define (process-next-ch-iter)
> (let ([ch (read-char aport)])
>   (printf "p->cs ch: ~a~n" ch)
>   (if (eof-object? ch)
>   empty-stream
>   (stream-cons
>ch
>(process-next-ch-iter)
>   
>   (process-next-ch-iter))
>
>
> (let ([my-port
>(open-input-string "xxjxx")])
>   
>   (let ([ch-stream (port->char-stream my-port)])
> (let-values ([(pos-found? pos)
>   (for/fold ([j-found? #f]
>  [pos 0])
> (#:break j-found?
>  ;#:final j-found?
>  [ch ch-stream]
>  [ch-idx (in-naturals 1)])
> (begin
>   (printf "ch: ~a~n" ch)
>   (printf "ch-idx: ~a~n" ch-idx)
>   (printf "(eq? ch #\\j): ~a~n" (eq? ch #\j))
>   (values
>(eq? ch #\j)
>ch-idx)))])
>   
>   (check-equal? pos-found? #t)
>
>   (check-equal? pos 3)
>
>   (close-input-port my-port
>
>
>

-- 
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/beaa2ef6-afd2-4686-829a-390eb69f5620n%40googlegroups.com.

Beyond the Racket Users Google Group, Racket Discussions take place on 
Discourse ( https://racket.discourse.group/ ) and Discord ( 
https://discord.gg/6Zq8sH5 ). Discussion (but less active) also takes place on 
the Racket Slack https://racket.slack.com/ ( sign up at 
https://racket-slack.herokuapp.com/ ), and IRC #racket 
https://kiwiirc.com/nextclient/irc.libera.chat/#racket
--- 
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/1489252c-4a85-4250-81a0-ef73e270a6bfn%40googlegroups.com.


[racket-users] PLDI 2023 Student Research Competition (SRC)

2022-12-12 Thread 'PLDI 2023 Publicity Chairs' via Racket Users
Please distribute widely.

# Call for Student Research Competition Submissions

The Student Research Competition (SRC) at PLDI allows students to present their 
research and get feedback from prominent members of the programming language 
research community. It’s an opportunity for students to network, practice 
presentation skills, and showcase their work. PLDI invites students (both at 
the graduate and undergraduate level) to submit their research.

Over the past three years, we have explored various ways to make the Student 
Research Competition (SRC) accessible to a wider audience. Every format comes 
with its own set of pros and cons. In fully virtual conferences, we miss seeing 
our friends and colleagues in person; on the other hand, we also enjoy seeing 
more participation globally. At the same time, many have found that a hybrid 
format inhibits engagement from all participants (remote and in-person). Last 
year, we introduced the two-track format where we incorporated the positive 
components of a hybrid event (increased accessibility) while mitigating the 
negative components (limited engagement). This year, we will again use the same 
format and hope that it will continue to increase participation!

## Two-Track SRC Model

This model comprises of two pools of submissions: (1) students who present 
their work primarily in-person, and (2) students who present their work 
primarily virtually. To aid with planning, students are strongly encouraged to 
select one of the tracks at submission time. We will do our best to accommodate 
any changes after submission.

Our hope is that the virtual track will allow more students to participate, 
regardless of travel restrictions or monetary constraints. However, we will 
note that virtual participants may have limited access to the rest of the 
conference depending on how the different programs are offered (e.g., if they 
are streamed or not). Thus, in-person attendees will likely be able to engage 
with the wider conference, and attendees, more fully.

*Note that the selection criterion of the Student Research Competition is not 
dependent on the mode of presentation. All students will be evaluated according 
to the same criteria.*

## Submission

The main body of the submission is a title and extended abstract consisting of 
the following:

**Problem and Motivation:** Clearly state the problem being addressed and 
explain the reasons for seeking a solution to this problem.

**Background and Related Work:** Describe the specialized (but pertinent) 
background necessary to appreciate the work in the context of PLDI areas of 
interest. Include references to the literature where appropriate, and briefly 
explain where your work departs from that done by others.

**Approach and Uniqueness:** Describe your approach in addressing the problem 
and clearly state how your approach is novel.

**Results and Contributions:** Clearly show how the results of your work 
contribute to programming language design and implementation in particular and 
to computer science in general; explain the significance of those results.

The final submission must also include the student author’s name, email 
address, institutional affiliation, research advisor’s name(s), ACM student 
member number, category (undergraduate or graduate), and mode of presentation 
(in-person or virtual). We recommend including all this information in the 
standard author contact information region.

Submissions must be original research that is not already published at PLDI or 
another conference or journal. One of the goals of the SRC is to give students 
feedback on ongoing, unpublished work. Furthermore, the abstract must be 
authored solely by the student. If the work is collaborative with others and/or 
part of a larger group project, the abstract should make clear what the 
student’s role was and should focus on that portion of the work.

The extended abstract must not exceed 1000 words and must not be longer than 2 
pages. Reference lists do not count towards these limits.

When you’re ready, submit your extended abstract at the submission site: 
https://pldi23src.hotcrp.com/.

Should you have any questions on if your work is a good fit for the SRC track, 
please reach out to the SRC Co-Chairs.

## Presentation and Attendance

Students accepted to the SRC based on their extended abstracts will proceed to 
the Poster (pre-Finale) Round. For the Poster Round, students must submit:

* a research poster to present at PLDI,
* a 5-minutes pre-recorded talk

In the two-track SRC model, the in-person track will be formatted as a 
traditional SRC: there will be an in-person poster session for three hours, in 
which PLDI attendees and in-person judges can walk around and interact with the 
students. The virtual track will be held in a virtual space that will be 
available to all PLDI attendees. In addition, we will have a pool of virtual 
judges that will walk around and interact with the virtual 

[racket-users] a for/fold #:break question, I think

2022-12-12 Thread tbh...@gmail.com
hi, I'm trying to do something slightly harder than what the attached 
example tries to do, but this example suffices to show that I, evidently, 
am missing something about how for/fold and/or #:break work together. 

(I have used both before, but have gotten out of practice with racket of 
late and am stuck longer on this than seems reasonable.)

I expect both tests to pass, but both fail (the "j" for jewel in "xxjxx") 
is seen but not "found", as it were.

I'd be grateful for a bug fix and/or explanation.

Cheers,

Tim Hanson



#lang racket

(require rackunit)

(define (port->char-stream aport)
  (printf "(port->char-stream aport)~n")
  (define (process-next-ch-iter)
(let ([ch (read-char aport)])
  (printf "p->cs ch: ~a~n" ch)
  (if (eof-object? ch)
  empty-stream
  (stream-cons
   ch
   (process-next-ch-iter)
  
  (process-next-ch-iter))


(let ([my-port
   (open-input-string "xxjxx")])
  
  (let ([ch-stream (port->char-stream my-port)])
(let-values ([(pos-found? pos)
  (for/fold ([j-found? #f]
 [pos 0])
(#:break j-found?
 ;#:final j-found?
 [ch ch-stream]
 [ch-idx (in-naturals 1)])
(begin
  (printf "ch: ~a~n" ch)
  (printf "ch-idx: ~a~n" ch-idx)
  (printf "(eq? ch #\\j): ~a~n" (eq? ch #\j))
  (values
   (eq? ch #\j)
   ch-idx)))])
  
  (check-equal? pos-found? #t)

  (check-equal? pos 3)

  (close-input-port my-port


-- 
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/beaa2ef6-afd2-4686-829a-390eb69f5620n%40googlegroups.com.

Beyond the Racket Users Google Group, Racket Discussions take place on 
Discourse ( https://racket.discourse.group/ ) and Discord ( 
https://discord.gg/6Zq8sH5 ). Discussion (but less active) also takes place on 
the Racket Slack https://racket.slack.com/ ( sign up at 
https://racket-slack.herokuapp.com/ ), and IRC #racket 
https://kiwiirc.com/nextclient/irc.libera.chat/#racket
--- 
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/b2f243a7-9ae9-40c5-97fb-3d159bdbbdf8n%40googlegroups.com.