[racket-users] Re: Scribble markdown renderer: tables

2020-12-29 Thread Alex Harsanyi

I am not entirely sure what it is that is not working, so I am just 
guessing here:

* If you are generating Markdown files that contain tables, you need to be 
aware that tables need to be in column 0 (i.e. NOT indented).  If they are 
indented, they will be rendered as pre-formatted text.
* If you are using the `markdown` package to parse Markdown file, it does 
not support tables.  You either need to merge  Add support for table by 
antoineB · Pull Request #56 · greghendershott/markdown (github.com) 
 , or use the 
`markdown-ng` package.

Hope this helps,
Alex. 

On Tuesday, December 29, 2020 at 10:17:21 PM UTC+8 dominik@trustica.cz 
wrote:

> Hello Racketeers,
>
> back from my procrastination projects to work :)
>
> In the biggest project our company is working on right now, we use
> Racket HTTP/REST backend and React.js frontend. The whole backend is
> fully contracted - even all the actual servlets that are exposed via
> HTTP are contracted. And in addition to it, they are all fully
> documented using scribble/srcdoc.
>
> I am using some syntax trickery to generate a table of API calls, so
> that the frontend developers can easily find the right documentation. It
> is just a transformation of dispatch-case to scribble tabular procedure.
>
> With PDF output, it works like a charm. With markdown, the tables get
> rendered as fixed-width columns - but it is still a plain text. No
> markers, nothing.
>
> Just to complete the picture, we are using CI/CD to automatically update
> project's Gitlab wiki.
>
> Am I missing something, or the markdown renderer produces incorrect
> output and I should fix it?
>
> Any hints will be VERY appreciated as the frontend is developed mostly
> by non-programmers, so it would really help to have everything they need
> in one interface (CI pipeline results, issues tracking, backend
> documentation).
>
>
> Cheers,
> Dominik
>

-- 
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/7d0d585f-0191-47ea-8979-ccbf71cf7a18n%40googlegroups.com.


[racket-users] Split-pane editing

2020-12-29 Thread Hendrik Boom
When editing code in emacs, I oftern split the pane so I have views on two 
parts of a 
file.
Typically, this is so I can see a function definition in one pane at the same 
time as I  
see a corresponding function application in another pane.
Sometimes, this escalates to three panes.

Is there any way to do something similar in drracket?

-- hendrik

-- 
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/20201229225319.jtxd73vfv4zxok2j%40topoi.pooq.com.


Re: [racket-users] resumable exceptions (or: How can I break myself?)

2020-12-29 Thread je...@lisp.sh
Using parameters is a helpful suggestion. In my case, it's enough to just 
record the error and add a substitution character (explicitly marked as 
induced, that is, wasn't actually present in the input) without needing to 
rewind or advance the input port. It's sufficient for my purposes to just 
accumulate the errors as they occur. Thanks!

On Tuesday, December 29, 2020 at 12:32:52 PM UTC+1 rmculp...@gmail.com 
wrote:

> I would suggest avoiding exceptions and continuations and have a separate 
> parameter[*] that holds the current unexpected character handler. You'll 
> still have to figure out what kind of thing it returns (void, or a 
> replacement character, or a new input port?), but you have to do that 
> anyway. 
>
> The handler can raise an ordinary, non-continuable exception if it can't 
> repair the problem. Or it could do weird continuation stuff like capture 
> the part of the continuation since the handler was installed and apply it 
> to multiple characters to see if one works (but that would not work well 
> with stateful objects like input ports).
>
> Ryan
>
> [*] or argument, if that turns out to fit your code better
>
>
> On Tue, Dec 29, 2020 at 11:27 AM je...@lisp.sh  wrote:
>
>> I'm working on a tokenizer for that involves some level of 
>> "self-healing": if the input port contains an unexpected character, an 
>> error token is to be emitted, but computation isn't over -- we are to 
>> continue by substituting the bad character with a good one, emitting that, 
>> too (thereby recovering), and keep rolling.
>>
>> When the tokenizer encounters an unexpected character, what I'd like to 
>> do is similar to raising/throwing an exception, but what's going on isn't 
>> (in my understanding) quite the same as raising an exception, because I 
>> don't want to just have some ambient exception handler deal with the error, 
>> since my understanding is that exceptions don't have enough information to 
>> simply resume the computation. I guess I'd like to install a prompt, but 
>> when control goes back to the prompt, I'd like it to be possible to resume 
>> the computation.
>>
>> An old discussion here from 2015, with John Carmack ("continuing after a 
>> user break"), comes close to what I have in mind. It's about setting up a 
>> handler for breaks. I guess what I have in mind are breaks, but what's not 
>> clear to me is how to raise them in my code. It seems like `break-thread` 
>> is the only way to do that? The discussion of breaks in the docs involves a 
>> lot of talk about threads and user interaction. But what I'm doing isn't 
>> really about threads at all (I'm making a tokenizer, not a REPL or other 
>> interactive program), so it leaves me feeling uncertain that I want breaks 
>> after all. And even if breaks are a technically viable solution, I wonder 
>> if there are any performance penalties or other gotchas that could be 
>> avoided by using some other continuation forms.
>>
>> Here's some pseudo-Racket that gets at what I'm looking for:
>>
>> ; compute a list of tokens
>> ; -> (listof (char? or eof))
>> (define (handle-many)
>> (watch-for-break (lambda (e) (handle-break e))
>> (match (handle-one)
>> [(? eof-object?) '(eof)]
>> [(? char? c) (cons c (handle-one))])))
>>
>> ; -> char? or eof
>> (define (handle-one)
>> (define c (peek-char))
>> (match c
>> [(? eof-object?) eof]
>> [#\f
>> (break-with c) ; pass the unexpected character to the caller...
>> (read-char in) ; ...but after that, resume here!
>> #\a]
>> [else
>> (read-char in)
>> #\b]))
>>
>> Any suggestions?
>>
>> Thanks,
>>
>> Jesse
>>
>> -- 
>> 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/e455208d-0ac9-41d6-ad08-dd3d08e12baan%40googlegroups.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/e6445f8d-3008-47fc-9b4d-cee9785789cbn%40googlegroups.com.


[racket-users] Re: Permutations ind Racket

2020-12-29 Thread br...@lojic.com
Kira:

You mentioned things (map, foldr, ...) that you're not permitted to use, 
but I don't know the full homework requirements. If your professor did not 
preclude the built-in permutations function, you could use that as a way of 
teaching your professor to communicate the requirements more clearly - they 
love that sort of thing ;)

https://docs.racket-lang.org/reference/pairs.html?q=permutations#%28def._%28%28lib._racket%2Flist..rkt%29._permutations%29%29

Brian

On Tuesday, December 15, 2020 at 8:12:25 AM UTC-5 kiel@gmail.com wrote:

> I study programming and have to do permutations in Racket without 
> something like map , foldr, remove, remq, sort! or begin. So now i have a 
> code but it doesn't show me every Permutation and some dopple. I can't find 
> the issue or how to fix and program it right only using recursion. Maybe 
> some of you know how to help me and find my logical or programming issue.  
> Here you can find a github link to my code.
> https://gist.github.com/KiraBen/fd70ea1063dfcdadfea0332343e37558
>
> Thank you for your help. 
>
> With greetings Kira Bender
>

-- 
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/d65c721c-bc2a-46dd-ba89-bc19ec84ee1en%40googlegroups.com.


[racket-users] Re: Executing (system ...) command requires another 'ENTER' from repl?

2020-12-29 Thread br...@lojic.com
The documentation for (system) states:

"The resulting process writes to (current-output-port), reads from 
(current-input-port), and logs errors to (current-error-port)."

So, I'm guessing that it may be waiting for input. The following does not 
require an extra enter key:

(parameterize ([current-input-port (open-input-string "")])
  (with-output-to-string (lambda () (system "ls"

Also, DrRacket doesn't require an extra enter key, so maybe there is 
something going on unique to the command line REPL.

On Sunday, December 13, 2020 at 5:19:56 PM UTC-5 mlist...@gmail.com wrote:

> Hi,
>
> I wonder why I need to press ENTER *twice *in the racket REPL for this 
> command:
>
> racket
> Welcome to Racket v7.9 [bc].
> > (with-output-to-string (lambda () (system "ls")))
>
> "a.rkt\nfuncs.rkt\nliteral.rkt\nparser.rkt\nparser-test.rkt\nt.rkt\ntuvalu.rkt\n"
>
> >
>
> It executes normally if I run this in a Racket  script as below:
>
> #lang racket
> (with-output-to-string (lambda () (system "ls")))
>
>
>

-- 
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/87990541-c13d-4aa9-add3-b695375e9a86n%40googlegroups.com.


[racket-users] Re: Dynamic-place PR

2020-12-29 Thread br...@lojic.com
Maybe ask on https://groups.google.com/g/racket-dev ?

On Wednesday, December 9, 2020 at 10:41:51 AM UTC-5 na...@manicmind.earth 
wrote:

> Hello.
>
> Is the PR #3518 “Create `racket/place/dynamic` to reduce dependencies.” 
> going to happen?
>
> I was trying to use ‘#%place and its `dynamic-place` but realized i have 
> to do some management of streams, i think.
>
> Nate

-- 
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/70c39af4-0da0-4ad3-9802-5c557edecfb6n%40googlegroups.com.


[racket-users] Re: I‘m new to racket, i want to know the best resources of learning racket

2020-12-29 Thread br...@lojic.com
If you like learning by example, I have a github repo w/ many examples:

https://github.com/lojic/LearningRacket

On Thursday, December 3, 2020 at 5:19:43 AM UTC-5 cy691...@gmail.com wrote:

> Any suggestions? Thanx for you guys

-- 
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/e93e6ed0-27b4-4112-9e7e-6ebceb96e37an%40googlegroups.com.


[racket-users] Scribble markdown renderer: tables

2020-12-29 Thread Dominik Pantůček
Hello Racketeers,

back from my procrastination projects to work :)

In the biggest project our company is working on right now, we use
Racket HTTP/REST backend and React.js frontend. The whole backend is
fully contracted - even all the actual servlets that are exposed via
HTTP are contracted. And in addition to it, they are all fully
documented using scribble/srcdoc.

I am using some syntax trickery to generate a table of API calls, so
that the frontend developers can easily find the right documentation. It
is just a transformation of dispatch-case to scribble tabular procedure.

With PDF output, it works like a charm. With markdown, the tables get
rendered as fixed-width columns - but it is still a plain text. No
markers, nothing.

Just to complete the picture, we are using CI/CD to automatically update
project's Gitlab wiki.

Am I missing something, or the markdown renderer produces incorrect
output and I should fix it?

Any hints will be VERY appreciated as the frontend is developed mostly
by non-programmers, so it would really help to have everything they need
in one interface (CI pipeline results, issues tracking, backend
documentation).


Cheers,
Dominik

-- 
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/1d189b9f-1bb8-34a5-83e9-8b39f468f0cc%40trustica.cz.


Re: [racket-users] resumable exceptions (or: How can I break myself?)

2020-12-29 Thread Ryan Culpepper
I would suggest avoiding exceptions and continuations and have a separate
parameter[*] that holds the current unexpected character handler. You'll
still have to figure out what kind of thing it returns (void, or a
replacement character, or a new input port?), but you have to do that
anyway.

The handler can raise an ordinary, non-continuable exception if it can't
repair the problem. Or it could do weird continuation stuff like capture
the part of the continuation since the handler was installed and apply it
to multiple characters to see if one works (but that would not work well
with stateful objects like input ports).

Ryan

[*] or argument, if that turns out to fit your code better


On Tue, Dec 29, 2020 at 11:27 AM je...@lisp.sh  wrote:

> I'm working on a tokenizer for that involves some level of "self-healing":
> if the input port contains an unexpected character, an error token is to be
> emitted, but computation isn't over -- we are to continue by substituting
> the bad character with a good one, emitting that, too (thereby recovering),
> and keep rolling.
>
> When the tokenizer encounters an unexpected character, what I'd like to do
> is similar to raising/throwing an exception, but what's going on isn't (in
> my understanding) quite the same as raising an exception, because I don't
> want to just have some ambient exception handler deal with the error, since
> my understanding is that exceptions don't have enough information to simply
> resume the computation. I guess I'd like to install a prompt, but when
> control goes back to the prompt, I'd like it to be possible to resume the
> computation.
>
> An old discussion here from 2015, with John Carmack ("continuing after a
> user break"), comes close to what I have in mind. It's about setting up a
> handler for breaks. I guess what I have in mind are breaks, but what's not
> clear to me is how to raise them in my code. It seems like `break-thread`
> is the only way to do that? The discussion of breaks in the docs involves a
> lot of talk about threads and user interaction. But what I'm doing isn't
> really about threads at all (I'm making a tokenizer, not a REPL or other
> interactive program), so it leaves me feeling uncertain that I want breaks
> after all. And even if breaks are a technically viable solution, I wonder
> if there are any performance penalties or other gotchas that could be
> avoided by using some other continuation forms.
>
> Here's some pseudo-Racket that gets at what I'm looking for:
>
> ; compute a list of tokens
> ; -> (listof (char? or eof))
> (define (handle-many)
> (watch-for-break (lambda (e) (handle-break e))
> (match (handle-one)
> [(? eof-object?) '(eof)]
> [(? char? c) (cons c (handle-one))])))
>
> ; -> char? or eof
> (define (handle-one)
> (define c (peek-char))
> (match c
> [(? eof-object?) eof]
> [#\f
> (break-with c) ; pass the unexpected character to the caller...
> (read-char in) ; ...but after that, resume here!
> #\a]
> [else
> (read-char in)
> #\b]))
>
> Any suggestions?
>
> Thanks,
>
> Jesse
>
> --
> 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/e455208d-0ac9-41d6-ad08-dd3d08e12baan%40googlegroups.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/CANy33qmgzGafKVDXp%3Do9Kqb5nOJ11Ys9K%3D9Ay%2BH24YgxaWddaA%40mail.gmail.com.


[racket-users] resumable exceptions (or: How can I break myself?)

2020-12-29 Thread je...@lisp.sh
I'm working on a tokenizer for that involves some level of "self-healing": 
if the input port contains an unexpected character, an error token is to be 
emitted, but computation isn't over -- we are to continue by substituting 
the bad character with a good one, emitting that, too (thereby recovering), 
and keep rolling.

When the tokenizer encounters an unexpected character, what I'd like to do 
is similar to raising/throwing an exception, but what's going on isn't (in 
my understanding) quite the same as raising an exception, because I don't 
want to just have some ambient exception handler deal with the error, since 
my understanding is that exceptions don't have enough information to simply 
resume the computation. I guess I'd like to install a prompt, but when 
control goes back to the prompt, I'd like it to be possible to resume the 
computation.

An old discussion here from 2015, with John Carmack ("continuing after a 
user break"), comes close to what I have in mind. It's about setting up a 
handler for breaks. I guess what I have in mind are breaks, but what's not 
clear to me is how to raise them in my code. It seems like `break-thread` 
is the only way to do that? The discussion of breaks in the docs involves a 
lot of talk about threads and user interaction. But what I'm doing isn't 
really about threads at all (I'm making a tokenizer, not a REPL or other 
interactive program), so it leaves me feeling uncertain that I want breaks 
after all. And even if breaks are a technically viable solution, I wonder 
if there are any performance penalties or other gotchas that could be 
avoided by using some other continuation forms.

Here's some pseudo-Racket that gets at what I'm looking for:

; compute a list of tokens
; -> (listof (char? or eof))
(define (handle-many)
(watch-for-break (lambda (e) (handle-break e))
(match (handle-one)
[(? eof-object?) '(eof)]
[(? char? c) (cons c (handle-one))])))

; -> char? or eof
(define (handle-one)
(define c (peek-char))
(match c
[(? eof-object?) eof]
[#\f
(break-with c) ; pass the unexpected character to the caller...
(read-char in) ; ...but after that, resume here!
#\a]
[else
(read-char in)
#\b]))

Any suggestions?

Thanks,

Jesse

-- 
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/e455208d-0ac9-41d6-ad08-dd3d08e12baan%40googlegroups.com.