#racket

/

      • vkirilichev joined the channel
      • CoderPuppy joined the channel
      • endobson has quit
      • slemonide joined the channel
      • cpup joined the channel
      • CoderPuppy has quit
      • slemonide has quit
      • ziyourenxiang has quit
      • CoderPuppy joined the channel
      • endobson joined the channel
      • matzy_ joined the channel
      • cpup joined the channel
      • matzy_
        hey, when you have a series of words in a list, what type are each of the words? e.g. '(the big dog ran fast) -> dog
      • or 'dog i guess, if it matters
      • is it a symbol? bc you can use symbol->string to turn it into "dog", is that right?
      • tomaranai_ joined the channel
      • tomaranai_ is now known as xuanrui
      • lexi-lambda
        matzy_: yes, it is a symbol.
      • YuGiOhJCJ joined the channel
      • matzy_
        lexi-lambda: how can i turn ("dog") into a symbol?
      • lexi-lambda
        rudybot: (string->symbol "dog")
      • rudybot
        lexi-lambda: error: with-limit: out of time
      • lexi-lambda
        rudybot: init racket
      • rudybot
        lexi-lambda: your sandbox is ready
      • lexi-lambda
        rudybot: (string->symbol "dog")
      • rudybot
        lexi-lambda: ; Value: 'dog
      • lexi-lambda
        matzy_: ^
      • matzy_
        oh wow
      • i swore i tried that
      • must be going crazy. thank you!
      • CoderPuppy joined the channel
      • mizu_no_oto joined the channel
      • see it gets pissed off. " expected: string? given: '("would") "
      • does that ' make it a symbol regardless?
      • greghendershott
        "would" is a string but '("would") is a list, a member of which is a string
      • You could do (map string->symbol '("would"))
      • i.e. "change this list of strings to a list of symbols"
      • Or if you only care about the first member of the list, get it out with `car` or `first`, then give it to string->symbol.
      • (string->symbol (car '("would")))
      • matzy_: ^
      • '("dog") is the same as (list "dog")
      • Quoting can be a little confusing at first in Scheme and Racket
      • endobson has quit
      • If you're using DrRacket, you might want to go Language | Choose Language ...
      • Click "Show Details" if the dialog box is skinny, to make it wider ...
      • And where you see the radio buttons for "Output Style" ...
      • Select "Constructor" (instead of the default which is probably "print" for you)
      • Now it will print '("dog") as (list "dog")
      • YuGiOhJCJ has quit
      • That might help you, I'm not sure.
      • matzy_: ^
      • lexi-lambda
        matzy_: see also my answer “What is the difference between quote and list?” on stack overflow https://stackoverflow.com/a/34984553/465378
      • endobson joined the channel
      • greghendershott
        + 1 million
      • Sauvin has quit
      • Bock joined the channel
      • lexi-lambda
        I increasingly feel that quote should not be in #lang racket2 (only quote-syntax)
      • greghendershott
        I'm embarrassed how long it took me to grok that in my early days with Racket.
      • lexi-lambda
        quote is confusing and makes little sense in a language that distinguishes syntax from datums, imo.
      • cpup joined the channel
      • matzy_ has quit
      • matzy_ joined the channel
      • greghendershott
        Oh wait do you mean merely get rid of the ' reader shorthand, or also quote?
      • lexi-lambda
        I mean get rid of both of them.
      • matzy_
        greghendershott: and lexi-lambda thank you both so much
      • lexi-lambda
        Though you could repurpose the shorthand for a real list literal syntax if you wanted.
      • vkirilichev joined the channel
      • greghendershott
        I'm sympathetic to discouraging '("too" "lazy" "to" "type" "list" "here")
      • And making the printer by default not lazy that way, too :)
      • OTOH I mean, there are data structures like x-expressions that are 99.9% symbols and strings, often deeply nested ...
      • lexi-lambda
        Yeah, I’ve thought about that, and I think what you really want is a real templating DSL. `datum` from syntax/datum is a good source of inspiration for a starting point, but template from syntax/parse/experimental/template could add to that.
      • After all, using quasiquote for templating means you’re writing your templates like CL-style macros, and don’t we all agree our pattern-based macros are much easier to read? :)
      • slemonide joined the channel
      • slemonide has quit
      • jao joined the channel
      • CoderPuppy joined the channel
      • greghendershott
        lexi-lambda: I haven't thought about it as much as you. :)
      • lexi-lambda
        I thought about it more before Hackett became my primary goal, since before that I spent a lot more time thinking about a Racket web framework.
      • greghendershott
        I actually have mixed feelings about how syntax templates automagically "unquote" pattern variables?
      • acertain joined the channel
      • It's not textually apparent, unlike quasiquote and quasiunquote
      • Some folks use a naming convention for pattern variables, to help
      • I've never done that, but, I see the need
      • Any I guess that's just micro ergonomics
      • lexi-lambda
        I see the argument on both sides. Not sure I have a strong opinion either way.
      • endobson has quit
      • matzy_ has quit
      • mejja has quit
      • cpup joined the channel
      • slemonide joined the channel
      • CoderPuppy joined the channel
      • thebardian joined the channel
      • matzy_ joined the channel
      • slemonide has quit
      • cpup joined the channel
      • Bock is now known as Sauvin
      • vkirilichev joined the channel
      • CoderPuppy joined the channel
      • ArneBab_ joined the channel
      • jao has quit
      • pagurus has quit
      • pagurus joined the channel
      • cpup joined the channel
      • vkirilichev has quit
      • CoderPuppy joined the channel
      • ebzzry joined the channel
      • matzy_ has quit
      • slemonide joined the channel
      • slemonide has quit
      • vkirilichev joined the channel
      • matzy_ joined the channel
      • vkirilichev has quit
      • matzy_ has quit
      • slemonide joined the channel
      • slemonide has quit
      • Lowl3v3l joined the channel
      • endobson joined the channel
      • cpup joined the channel
      • vkirilichev joined the channel
      • vkirilichev has quit
      • FreeFull has quit
      • CoderPuppy joined the channel
      • dan_f has quit
      • thebardian has quit
      • thebardian joined the channel
      • sondr3 has quit
      • thebardian has quit
      • thebardian joined the channel
      • Lowl3v3l has quit
      • endobson has quit
      • mgu joined the channel
      • vkirilichev joined the channel
      • sondr3 joined the channel
      • cpup joined the channel
      • thebardian_ joined the channel
      • thebardian has quit
      • CoderPuppy joined the channel
      • sondr3 has quit
      • vkirilichev joined the channel
      • dca joined the channel
      • sondr3 joined the channel
      • ijp has quit
      • ijp joined the channel
      • cpup joined the channel
      • soegaard joined the channel
      • davidl joined the channel
      • sondr3 has quit
      • CoderPuppy joined the channel
      • Lowl3v3l joined the channel
      • sondr3 joined the channel