Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Drew Crampsie
    @drewc
    Then lay the JS grammar on top and my mind starts to explode with points. While I have the insight to see a shiteload of points the wisdom to connect said points is a wee bit beyond me at this particular point in time... if you get the point I am trying to point towards.
    drewc @drewc is trying not to be pointless and it turned into an end-to-end schoolyard game with lots of points on all sides with no clear winner ... Hmmmm .... know what to do?
    Drew Crampsie
    @drewc
    10:19 AM? "It's time to get, to the point, let's roll, another joint! Compile scheme, to JS... namespace: "#" is the best! You don't know how it names... you don't know how it calls ... you don't know how it ref's ... your sym-bols"
    Before I get high, let me say that I remember the JS grammar being crazy for almost every token... and my head keeps pointing out a flaw in my design where I went for greed over speed to make it general in design as that was part of the requirements.
    Jaime Fournier
    @ober
    What is the right pattern to do this the right way, without hard coding values? https://gist.github.com/eb3e36e09e48eb99af85174c63719acf
    Drew Crampsie
    @drewc
    @ober
    > (let ((hd '("A" "B" "C")) (lns '((1 2 3) (foo bar baz)))) 
         (map (lambda (ln) 
                    (let (jso 'individual-hash-table) 
                        (map (lambda (k v) `(set-hash-here-for ,jso ,k ,v)) hd ln))) lns))
    
    => 
    (((set-hash-here-for individual-hash-table #0="A" 1) (set-hash-here-for individual-hash-table #1="B" 2) (set-hash-here-for individual-hash-table #2="C" 3))
     ((set-hash-here-for individual-hash-table #0# foo) (set-hash-here-for individual-hash-table #1# bar) (set-hash-here-for individual-hash-table #2# baz)))
    obviously return the hash table, and not my psuedafed
    Jaime Fournier
    @ober
    aye. thanks.
    ahh ` quote for a macro
    Drew Crampsie
    @drewc
    but in general, the best way to map is map
    :P
    Jaime Fournier
    @ober
    hygiene scared me away from scheme macros
    cattle prod used for anonymous functions
    Drew Crampsie
    @drewc
    there are no macros there ... not sure what you are referring to ... but I use quasiquote all the time, even for syntax.
    Here's more along the lines of what you want:
    1> (let ((hd '("A" "B" "C")) (lns '((1 2 3) (foo bar baz)))) (map (lambda (ln) (let (jso (make-table)) (map (lambda (k v) (table-set! jso k v)) hd ln) jso)) lns))
    (#<table #5> #<table #6>)
    1> (map hash->list #)
    (((#0="C" . 3) (#1="B" . 2) (#2="A" . 1)) ((#0# . baz) (#1# . bar) (#2# . foo)))
    1>
    Jaime Fournier
    @ober
    ahh quote yes. sorry newb here
    what is # a shortcut for in the map call?
    last result?
    ober @ober has only used quote in compiler macros
    Marc-André Bélanger
    @belmarca
    no (def my-list '(1 2 3)) ?
    Drew Crampsie
    @drewc
    @ober In the repl, that is the last value
    In other words: # = (#<table #5> #<table #6>)
    Drew Crampsie
    @drewc
    In common lisp there is no quasiquote, and no square brackets for list syntax, but there is `(,v ,@vs) syntax, which scheme has as well.
    > (def lst [1 2 3])
    > `(,0 ,@lst)      
    (0 1 2 3)
    > [0 lst ...]
    (0 1 2 3)
    J Roberto
    @jordeam
    @belmarca I couldn't find out the make target for automatic docs and refs, can you point it out?
    Jaime Fournier
    @ober
    TAGS is the make target
    src/build.sh build_tags
    src/build.sh tags even
    build_doc () { feedback_low "Build gerbil docs" GERBIL_HOME="${GERBIL_BASE}" #required by gxtags export GERBIL_HOME (cd "${GERBIL_HOME}/doc" && npm install && node_modules/vuepress/cli.js dev) }
    @jordeam ^^
    Marc-André Bélanger
    @belmarca
    ah sorry it's in build.sh
    src/./build.sh doc
    @jordeam it builds the docs and serves it on localhost
    J Roberto
    @jordeam
    Thanks @belmarca and @ober. But something like Doxygen, which generates references for functions, macros, etc., directly from the comments made inside the code, if they have a proper syntax, of course, is someone working on that?
    Marc-André Bélanger
    @belmarca
    that was discussed but it didn't go anywhere. The consensus seems to be that it's preferable to separate docs and code.
    Jaime Fournier
    @ober
    #'describe would be nice
    Jaime Fournier
    @ober
    would be nice if build.sh was aware of file changes and only rebuilt what was required, ala make
    vyzo
    @vyzo
    I plan to work on describe sometime soon (this century :)
    I'll be getting 2-3 weeks off from work around xmas, so I can work on it
    junkerjoe
    @junkerjoe
    logic programming in scheme
    junkerjoe
    @junkerjoe
    program synthesis for free
    so cool
    vyzo
    @vyzo
    I'd love to have a logic programming library in the stdlib
    Jaime Fournier
    @ober
    yeah
    junkerjoe
    @junkerjoe
    It was really cool seeing miniKanren in action. Will Byrd gave an example of it generating an append program from scratch, just from giving it constraints of what the input and output should look like.
    When asking about it after the presentation, he said miniKanren should have no issues with being compatible with Gambit, so probably Gerbil as well.
    Marc-André Bélanger
    @belmarca
    interesting