
../../racket/racket/share/pkgs/drracket/drracket/private/stack-checkpoint.rkt:40:30: returned two values to single value return context

I don’t know what to make of it, or what it has to do with my source code. The backtrace has only this one entry.

The code that triggers this error is open-source: https://github.com/joergen7/cfplot

I’m using Racket v7.5.0.7 [cs]

For now I’ve decided to downgrade to Racket v7.5 in the C implementation.

… and it works again. Sry for bothering you with my petty problems.

@joergen7 can you report a bug? Especially useful to know if it happens 7.5 Racket CS or on traditional Racket in the snapshot.

I can. let me look up your bugtracker …

is it the one on the github?

Yes

@kamil.beker has joined the channel

Hey :raised_hand_with_fingers_splayed::skin-tone–2:

Hi

What is the Good place to start Learning Racket?

Writing small useful tools for yourself, then practice, practice…

I found Realm of Racket very useful.

I mean it applies to everything probably :face_with_monocle:

Pick a project. Lookup what you need in the Guide. If you are starting from scratch, check out https://docs.racket-lang.org/quick/index.html

I know Racket Docs and RacketCon is good starting point, but maybe You have some personal favorites? :)

Need to check that then :)

It is very beginner-oriented. You could learn Racket as a first language from that book.

Also if you are coming from another language and experience something missing - then ask here. Odds are that there is an Racket equivalent (but maybe under another name).

Thanks :)

Using Racket to solve Advent of Code (or other “platforms”) problems is another choice.

HTDP is worth a look

@samth I have issued the following bug, regarding my problem earlier today: https://github.com/racket/racket/issues/2951

Thanks!

One thing that might be a workaround is to disable debugging in the language menu in DrRacket

I’ll try that and add the result to the observation.

would be interesting to combine with RacketScript

I use it to write a lot of little one-off utility scripts at work, but also doing Project Euler exercises are good ways to learn a lang

since they are fairly discrete problems

Newbie question, what’s the idea behind creating many dialects of language inside one language?

@paulvorobyev has joined the channel

Check this out: https://beautifulracket.com/appendix/why-lop-why-racket.html

FWIW The teaching languages probably count as dialects, but many others are distinct languages :grinning:

so in theory every new ‘LOP’ is just a DSL over Racket?

or am I missing something


@psnively has joined the channel

Hi everyone! First, thanks for doing so much to deliver on the promise of “Scheme as programmable programming language.”

In that vein, I’m confused about something. It used to be, in DrScheme, that choosing the FrTime language resulted in a REPL whose GUI elements were defined in terms of the FrTime wrappers for the underlying toolkit, so e.g. evaluating seconds
would result in a history item that was literally the dynamic representation of that signal, i.e. it would update every second, for the world’s shortest bang-to-buck demo.

This doesn’t seem to be the case in DrRacket if I choose #lang frtime
in the definition frame and Run
it to get the REPL’s language to be correct.

Is this an accurate understanding, and if so, is there any (straightforward) way to recover the old behavior?

@psnively in the Language dialog, select Other Languages, and FrTime should appear. It will still have that behavior (I just checked)

The protocol between #lang
-based languages and DrRacket is not enough to implement everything the FrTime language does.

@samth: First, thank you for that. Second, let me take this opportunity to apologize for some past intemperate comments I’ve made; I was out of line. Third, there seems to be an issue, at least on my Linux distro, with frames for GUI elements being too small and either unresizable, or because of some quirk of how coordinates are interpreted, clicking on what appears to be the lower-right corner of the frame doesn’t actually allow me to resize them. Does this ring any bells?

Yes, that makes sense.

That is, to elaborate: much of the “Language dialog” is out of frame, and I haven’t been successful in finding a way to resolve that.

@psnively thanks, no worries.

For the Language dialog, it also doesn’t resize for me — I think it’s not intended to be resizable

This makes me suspect there’s some issue, perhaps, in sizing the frame according to, e.g. contents font metrics?

Like maybe it’s dependent on some external notion of “GUI font” to use, and mine is too large? This is very reasonable, as I’m visually impaired, and so I tend to use large fonts.

Hmmm. Let me poke at some system settings.

I can imagine that if it had large fonts it would be too big for the screen

My system setting says “Normal,” which is odd in itself: I thought I’d changed that.

I can see the problem if I increase the zoom on my display

That’s unfortunate.

Hmm. Glad it’s reproducible, anyway.

OK, so, newbie question: what’s the syntax for taking one program fragment and reusing it? I think that’s probably a thing in Lisp.

If I wanted to take (define i 1)
(cond
[(= i 1) print "i is 1"]
[else (print "nope")])
and store the conditions elsewhere, how would I go about it? I think it would be something like: (define cclause '(
[(= i 1) print "i is 1"]
[else (print "nope")]
))
(define i 1)
(cond
,cclause
)
except I’m not sure what the actual syntax would be - I’m a bit lost with prefixes.


Thanks, but I think something even weirder is going on.


This is with no screen zoom, normal font size, and I changed my default font in Elementary OS to “Ubuntu Regular,” just in case Elementary’s default font metrics were confusing the issue.

But as you can see, the font rendering is actually bleeding outside the containing frame.

oh that’s very bad

It’s baffling, and yes, not good. :smile:

The syntax is “define”, but that works only for expressions - not arbitrary pieces of code. A cond clause such as [(= i 1) (print "i is 1")]
is not an expression, but it does contain two expressions: (= i 1)
and (print "i is 1")
.

But more directly: what are you trying to do?

Why is that?

my attempts to make my tokenizer use “lexer” for test cases and “lexer-src-pos” for personal debugging aren’t going well.

So I’m thinking I can simply define two different tokenizers, because the biggest part of the code is the find-and-replace-this definitions inside the lexer.

The issue is about the rendering of interaction results, and I don’t know the exact issue but I think Robby hasn’t figured out what the protocol should be.

It’s much easier to do with a language in DrRacket because that just extends the implemention of the interactions window itself

If I could outsource those definitions, the tokenizer would be about 7 lines - easy to duplicate.

I haven’t used the lexing stuff so I don’t know the difference between lexer
and lexer-src-pos
. Are they just different functions with the same signature? (number of arguments + return type)

The output has line and column numbers, for easier debugging, but otherwise it’s the same.

are you using the beautiful racket lexers or the standard racket lexers?

I could just cut in the output with regexps, I guess, but I thought I would learn lisp faster by finding a more elegant way to do it.

oh wait actually it doesn’t matter - both of them seem to provide this thing called define-lex-abbrev
that might work for what you want

The whole thing is pretty much pasted from beautifulracket

specifically the first jsonic part

ah, gotcha

then I found that lexer-src-pos was much better for debugging, because I can see where the error is, but it messes up the test cases I’ve already written.

Originally, I wanted something that just said "use lexer
if this parameter is #f and lexer-src-pos
if it’s #t. But doing that got increasingly complicated.

But on the bright side, this is great as inspiration for “stuff I want to work seamlessly in the new language I’m making”.

I don’t know enough (read: anything) about the guts of DrRacket’s interactions rendering, but I’d love to hear more about any related design decisions, since they impact and influence Pyret’s REPL as well… :slightly_smiling_face:

@blerner probably better to ask Robby directly

Yeah I figured :slightly_smiling_face: it’s not urgent, by any means

I think it’s really just a good argument for using a parser-combinator style library rather than the static lexer approach to things. Or instead just tweaking the API of the lexer library. There’s no good reason why the parameter you described can’t exist, it just wasn’t thought about at the time the lexer API was designed.

I don’t really know anything about any of this.

Eh, if I can’t make this stuff work, I’m probably not good enough to tweak the API yet…

If you feel comfortable, you could file a github issue asking for this. I think it’s a good feature request.

I’m not sure I know enough to formulate it correctly; I’ve only been trying to get a handle on lisp for a week or so.

Understood :) feel free to ask as many questions in the slack as you like

Thanks!

I’ve been thinking about trying Lisp for years, so I’ve built up this dream in my head where of course there’s a way to do every weird meta-code thing I can think of - it’s Lisp!

Reality is, as usual, more realistic.

Well. There are weird meta-code ways to do what you want, but using them will be unpleasant.