Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Apr 21 19:52
    jenshaase edited #244
  • Apr 21 19:44
    jenshaase synchronize #244
  • Apr 21 19:44

    jenshaase on persistent-data-structures

    Improved struct tests (compare)

  • Apr 21 19:19
    jenshaase synchronize #244
  • Apr 21 19:19

    jenshaase on persistent-data-structures

    Added more vector tests (compare)

  • Apr 21 18:24
    jenshaase synchronize #244
  • Apr 21 18:24

    jenshaase on persistent-data-structures

    Added more list tests (compare)

  • Apr 20 19:21
    jenshaase edited #244
  • Apr 20 19:21
    jenshaase synchronize #244
  • Apr 20 19:21

    jenshaase on persistent-data-structures

    Added new persistent struct and… (compare)

  • Apr 17 20:10
    jenshaase edited #244
  • Apr 17 19:52
    jenshaase edited #244
  • Apr 17 19:52
    jenshaase edited #244
  • Apr 17 19:52
    jenshaase synchronize #244
  • Apr 17 19:52

    jenshaase on persistent-data-structures

    Improved psalm doc types (compare)

  • Apr 17 19:50
    jenshaase synchronize #244
  • Apr 17 19:50

    jenshaase on persistent-data-structures

    Improved psalm doc types (compare)

  • Apr 17 19:49
    jenshaase synchronize #244
  • Apr 17 19:49

    jenshaase on persistent-data-structures

    Improving hash set and add __in… (compare)

  • Apr 17 14:44
    kloimhardt commented #261
Mario Bašić
@mabasic
Is there a way to dynamically create a table?
with a for loop maybe
Jens Haase
@jenshaase
(put table key value) (e.g. (put @{:a 1 :b 2} :c 3))
Mario Bašić
@mabasic
Thank you. I had to use foreach loop with put, because for always returns an array.
Mario Bašić
@mabasic
@jenshaase :parsed-body in a request is not working for me.
I know that we have a test for this, and that it passed
Mario Bašić
@mabasic
It's not a Phel issue after all. Even PHP does not see anything with $_POST
Mario Bašić
@mabasic
Found the data here (def data (json/decode (php/file_get_contents "php://input"))) xD since I was using application/json content-data xD
Should we place that in the request somewhere?
When the content-data is set to application/json should we place the above as :parsed-body instead of using $_POST?
Mario Bašić
@mabasic
There is a issue with my phel-json library. It converts strings to keywords for table keys. I should probably add an option to have it return either keywords or strings. This caused me a couple of minutes to work out.
Mario Bašić
@mabasic
Is there a strlen in Phel? For some reason I can't use count on a string.
Jens Haase
@jenshaase:matrix.org
[m]
php/strlen
Mario Bašić
@mabasic
I expected to find a (strlen x) function. But php/strlen does the job.
Mario Bašić
@mabasic
Is there a Phel function for explode ? It would seem that most of php functions for strings and arrays and to be used with (php/.. I was also looking for str_replace.
Jens Haase
@jenshaase
There are so many Php function. I will not wrap every function in phel.
Jose Maria Valera Reales
@Chemaclass
I would also say that. I think it's ok to use the native PHP functions for most of the common things such as strlen or similar.
But well, in case anyone find/does some interesting functions for phel that might get an additional advantage of having them in phel and not in native-php, then feel free and welcome to create a PR with it :)
Mario Bašić
@mabasic
It kind of makes sense. Making a 1 to 1 conversion is a big job, and the benefits are not really there, because (php/strlen "") instead of (strlen "") is trivial.
Mario Bašić
@mabasic
I'm really excited to share my code with you guys. Just a few things left before doing so.
Mario Bašić
@mabasic
Believe it or not, the website is complete: https://mariobasic.com/
The source code is here: https://github.com/mabasic/mariobasic-n7
Let me know what you think :)
There are some bugs that I need to polish like mobile experience etc.
Jose Maria Valera Reales
@Chemaclass
Pretty cool, @mabasic! 👌🏻👏
Jose Maria Valera Reales
@Chemaclass

Adding re-seq phel function 👉 phel-lang/phel-lang#259

Returns a sequence of successive matches of pattern in string.

lonelos
@lonelos

Let me know what you think :)

Nice job my fellow countryman. Just started exploring Phel and found this gem, thank you :)

Mario Bašić
@mabasic

Let me know what you think :)

Nice job my fellow countryman. Just started exploring Phel and found this gem, thank you :)

Thank you :heart:

Mario Bašić
@mabasic
@jenshaase Regarding PHP interop (calling phel from php). I haven't tested that part yet, but have you seen this article https://www.simonholywell.com/post/2016/10/importing-and-aliasing-php-functions/. I remember discussing something about not being able to call phel functions directly from php...
Jens Haase
@jenshaase
Problem is, that standard autoloading is not working in this case. Autloading only works for classes and not functions
metehan
@metehan
actuallly I just came back to gitter to see if you finished your website
oh it doesn't have permissive license :(
anyway congratulations for the website :)
Mario Bašić
@mabasic
@metehan Usually I use MIT license, but considering that this time I have my personal information in the source code it made no sense to allow everyone to use my personal information. Maybe there is a license for this case, but I don't know which one.
metehan
@metehan
phel extenstion for VS code is pretty fine but maybe we can integrate some paredit functionaly
now I use calva instead of phel extension. it gives bad coloring and thinks my core is wrong but without paredit coding lisp is hard
metehan
@metehan
is there any html to ignore itself lets say in clojurescript if you write [:<> [:p "as"] [:p "sda"]] the [:<> ]element will be ignored and [:pelements will be forwarded to parent of [:<>
Jens Haase
@jenshaase
You can use an array for that: (html @[[:p "a"] [:p "b"]])
6 replies
Mario Bašić
@mabasic
Interesting, did not know that. I just figured that it works like React JSX meaning that you need to have one "root" component.
@metehan The one thing that was really helpful when coding Phel is bracket matching in vscode. That is basically all that one would need. After some time you get used to working with brackets. The extension could provide symbols which would show functions and variables defined in a document. That would be helpful, but I managed without it.
@metehan Regarding the license, I will look into it at some point in the future. I'm currently busy with other projects, so I will have to circle back to this.
1 reply
metehan
@metehan

@metehan ...Phel is bracket matching in vscode. That is basically all that one would need...

it's totally not "all one would need" :) you came from php as your website indicates. I can't imagine an effective coding experience without paredit on a lisp language. You should install calva paredit. after you try it then there is no way back from lisp family languages ;)

thank you Jens for the sample
Sean Walker
@swlkr
theres also parinfer if youre into that
metehan
@metehan
for now I am happy with calva and without phel support. parinfer is fine but not complete; travelling through sexps , barfing and slurping are missing.
Mario Bašić
@mabasic
@jenshaase Do you think that including links to my website source code and/or phel-json library would be good to have on the phel website somewhere? Maybe like examples or something like that...
2 replies
kloimhardt
@kloimhardt
Just published a 100 loc Phel backend for the canonical "guestbook" web-example. Thank you @mabasic for the inspiration.
Mario Bašić
@mabasic
@kloimhardt Nice! I'm glad that my code has helped you in some way :heart:
Jens Haase
@jenshaase
Hi everybody. I just want to inform you that I'm working on a pretty big change regarding Phel's data structures. I will replace the existing data structure with new persistent data structures similar to Clojure's data structures. This will break a few things in the next version, but I think it's worth it. If you want you can have a sneak peek by looking a the Pull Request: phel-lang/phel-lang#244
1 reply
Mario Bašić
@mabasic
@kloimhardt Can you add your project here: phel-lang/phel-lang#261 ?
kloimhardt
@kloimhardt
@mabasic project added. At the moment I am using your splendid JSON library to performantly exchange data between cljs<->phel. But with JSON, sending data of the form [:key1 {:key2 2} :key3] is tricky. I wonder whether in the new Pull Request there exists some kind of "read-string" function which would perfectly fit reading a String of cljs/EDN data into the new Phel data structures. One would lose performance by sending a String instead of JSON, but it would be very convenient.