joergen7
2019-12-4 08:32:30

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


joergen7
2019-12-4 08:33:17

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.


joergen7
2019-12-4 08:35:18

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


joergen7
2019-12-4 08:39:02

I’m using Racket v7.5.0.7 [cs]


joergen7
2019-12-4 09:40:53

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


joergen7
2019-12-4 10:15:51

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


samth
2019-12-4 11:11:57

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


joergen7
2019-12-4 11:13:12

I can. let me look up your bugtracker …


joergen7
2019-12-4 11:15:45

is it the one on the github?


samth
2019-12-4 11:35:19

Yes


kamil.beker
2019-12-4 11:35:23

@kamil.beker has joined the channel


kamil.beker
2019-12-4 11:35:38

Hey :raised_hand_with_fingers_splayed::skin-tone–2:


samth
2019-12-4 11:47:49

Hi


kamil.beker
2019-12-4 12:12:43

What is the Good place to start Learning Racket?


dmitryhertz
2019-12-4 12:13:20

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


joergen7
2019-12-4 12:13:54

I found Realm of Racket very useful.


kamil.beker
2019-12-4 12:14:00

I mean it applies to everything probably :face_with_monocle:


soegaard2
2019-12-4 12:14:58

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

https://docs.racket-lang.org/guide/


kamil.beker
2019-12-4 12:15:16

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


kamil.beker
2019-12-4 12:15:36

Need to check that then :)


joergen7
2019-12-4 12:16:06

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


soegaard2
2019-12-4 12:16:45

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


kamil.beker
2019-12-4 12:17:53

Thanks :)


yfangzhe
2019-12-4 12:25:32

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


mark.warren
2019-12-4 12:41:04

HTDP is worth a look


joergen7
2019-12-4 13:14:15

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


samth
2019-12-4 13:14:28

Thanks!


samth
2019-12-4 13:15:26

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


joergen7
2019-12-4 13:32:23

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


d_run
2019-12-4 15:46:44

would be interesting to combine with RacketScript


d_run
2019-12-4 15:47:46

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


d_run
2019-12-4 15:48:06

since they are fairly discrete problems


kamil.beker
2019-12-4 17:17:09

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


paulvorobyev
2019-12-4 17:20:34

@paulvorobyev has joined the channel


ruyvalle
2019-12-4 17:23:25

spdegabrielle
2019-12-4 18:17:27

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


kamil.beker
2019-12-4 20:43:22

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


kamil.beker
2019-12-4 20:43:28

or am I missing something



psnively
2019-12-4 21:21:24

@psnively has joined the channel


psnively
2019-12-4 21:23:04

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


psnively
2019-12-4 21:24:51

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.


psnively
2019-12-4 21:25:32

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.


psnively
2019-12-4 21:25:52

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


samth
2019-12-4 21:28:09

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


samth
2019-12-4 21:28:41

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


psnively
2019-12-4 21:30:17

@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?


psnively
2019-12-4 21:30:38

Yes, that makes sense.


psnively
2019-12-4 21:31:27

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.


samth
2019-12-4 21:31:39

@psnively thanks, no worries.


samth
2019-12-4 21:32:37

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


psnively
2019-12-4 21:34:26

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


psnively
2019-12-4 21:35:10

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.


psnively
2019-12-4 21:35:31

Hmmm. Let me poke at some system settings.


samth
2019-12-4 21:35:52

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


psnively
2019-12-4 21:37:29

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


samth
2019-12-4 21:37:50

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


samth
2019-12-4 21:37:55

That’s unfortunate.


psnively
2019-12-4 21:38:18

Hmm. Glad it’s reproducible, anyway.


elyandarin
2019-12-4 21:39:32

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.


elyandarin
2019-12-4 21:40:23

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.


samth
2019-12-4 21:40:54

psnively
2019-12-4 21:55:41

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


psnively
2019-12-4 21:56:16

psnively
2019-12-4 21:57:21

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.


psnively
2019-12-4 21:57:39

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


samth
2019-12-4 21:57:45

oh that’s very bad


psnively
2019-12-4 21:58:00

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


notjack
2019-12-4 22:04:10

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


notjack
2019-12-4 22:05:17

But more directly: what are you trying to do?


notjack
2019-12-4 22:05:47

Why is that?


elyandarin
2019-12-4 22:08:04

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


elyandarin
2019-12-4 22:09:47

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.


samth
2019-12-4 22:12:22

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.


samth
2019-12-4 22:12:48

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


elyandarin
2019-12-4 22:13:38

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


notjack
2019-12-4 22:17:12

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)


elyandarin
2019-12-4 22:18:29

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


notjack
2019-12-4 22:21:18

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


elyandarin
2019-12-4 22:22:00

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.


notjack
2019-12-4 22:22:02

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


elyandarin
2019-12-4 22:22:29

The whole thing is pretty much pasted from beautifulracket


elyandarin
2019-12-4 22:22:41

specifically the first jsonic part


notjack
2019-12-4 22:23:06

ah, gotcha


elyandarin
2019-12-4 22:25:54

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.


elyandarin
2019-12-4 22:33:36

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.


elyandarin
2019-12-4 22:34:50

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


blerner
2019-12-4 22:36:53

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:


samth
2019-12-4 22:43:03

@blerner probably better to ask Robby directly


blerner
2019-12-4 22:43:28

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


notjack
2019-12-4 22:43:43

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.


samth
2019-12-4 22:47:03

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


elyandarin
2019-12-4 22:55:49

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


notjack
2019-12-4 22:57:51

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


elyandarin
2019-12-4 22:59:59

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.


notjack
2019-12-4 23:01:34

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


elyandarin
2019-12-4 23:02:03

Thanks!


elyandarin
2019-12-4 23:04:13

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!


elyandarin
2019-12-4 23:05:25

Reality is, as usual, more realistic.


notjack
2019-12-4 23:08:53

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