Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Sep 15 07:21
    Chemaclass review_requested #345
  • Sep 15 07:21
    Chemaclass review_requested #345
  • Sep 15 07:21
    Chemaclass assigned #345
  • Sep 15 07:21
    Chemaclass labeled #345
  • Sep 15 07:21
    Chemaclass opened #345
  • Sep 15 07:18

    Chemaclass on use-raw-arrays-for-config

    Use raw arrays for config (compare)

  • Sep 14 18:55
    Chemaclass assigned #344
  • Sep 14 18:10
    jenshaase converted_to_draft #344
  • Sep 14 18:10
    jenshaase opened #344
  • Sep 14 18:05

    jenshaase on compile-command-v2

    Added build facade to compile f… (compare)

  • Sep 12 16:54

    Chemaclass on split-in-smaller-methods

    (compare)

  • Sep 12 14:07

    jenshaase on phel-config-using-argument-unpacking

    (compare)

  • Sep 12 14:07
    jenshaase commented #343
  • Sep 12 14:07

    jenshaase on master

    Using arg unpacking in config d… Merge pull request #343 from ph… (compare)

  • Sep 12 14:07
    jenshaase closed #343
  • Sep 12 14:06
    jenshaase commented #7
  • Sep 12 14:06

    jenshaase on master

    Split run() into smaller methods Fix method arg type using Packa… Avoid passing array by ref and 2 more (compare)

  • Sep 12 14:06
    jenshaase closed #7
  • Sep 12 12:12
    Chemaclass synchronize #7
  • Sep 12 12:12

    Chemaclass on split-in-smaller-methods

    Avoid passing array by ref Minor clean up in loadConfigPac… (compare)

Jose Maria Valera Reales
@Chemaclass
wow, I never thought about this, @mabasic thanks for the catch! 🤓
Mario Bašić
@mabasic
I would not have caught this if my server wasn't out of space xD. Here is the issue where we can track this: phel-lang/phel-lang#247
Jose Maria Valera Reales
@Chemaclass
New PR : "Allow print transients data structures" phel-lang/phel-lang#272
Reported by @mabasic
3 replies
Jens Haase
@jenshaase
@/all I just released version 0.3.0 of Phel. This release adds persistent data structures to Phel. It probably will break some stuff from version 0.2.0. You can read more about the new data structures on the website: https://phel-lang.org/documentation/data-structures/
8 replies
Mario Bašić
@mabasic
Can I do pattern matching in Phel?
2 replies
Mario Bašić
@mabasic

Still using 0.2.0 on my website, but I've managed to implement this functionality:

(route "GET" "/blog" blog/index)
(route "GET" "/blog/{slug}" blog/show)

in my "controller" show function I get the slug like this:

(defn show [request & [@{:slug slug}]]
  (println slug))

It can be further improved to support optional route parameters. Going to move my blog from gatsby.js to phel (website). This was my only obstacle so far.

On a side note. Using 0.2 is now difficult since the documentation is for 0.3. Can we implement documentation versioning somehow?
Mario Bašić
@mabasic
@jenshaase Phel is awesome! It is very easy to get back into it after some time. The new data structures are great (immutable and mutable). PHP interop is great. I still haven't tried using Phel in PHP, but being able to deliver a single library with Phel and PHP code inside is awesome. I can really see this language being attractive to PHP developers who are looking for a change, but don't want to leave the PHP ecosystem.
Jens Haase
@jenshaase:matrix.org
[m]
Regarding documentation: you can read the documentation on on the GitHub repo. Switch to tag v0.2.0
Mario Bašić
@mabasic
Found it, thank you.
Mario Bašić
@mabasic
@jenshaase Can you publish a new release? I need a new version with the PR for for loops merged
Jens Haase
@jenshaase:matrix.org
[m]
Was that already in 0.3.1?
Was=wasn't
Mario Bašić
@mabasic
Hmm ... I am using 0.3.1 and it seems like the for loops are still a issue
Let me just check a few things
Mario Bašić
@mabasic
It is not the for loops, but something different, trying to debug now.
Mario Bašić
@mabasic
@jenshaase Can you please take a look at phel-lang/phel-lang#288 This is blocking me atm
Jens Haase
@jenshaase:matrix.org
[m]
Added a comment in the ticket
Mario Bašić
@mabasic
Thanks for the quick response :heart:
Mario Bašić
@mabasic
@jenshaase Managed to get to the culprit: phel-lang/phel-lang#287
kloimhardt
@kloimhardt
Upgraded my two in the in-the-wild projects to Phel 0.3.1 -- one issue:
I mimic an eval via writing code to a file "tmp.txt" and calling (load "tmp.txt"). It works, but again, is there an elegant way?
Jens Haase
@jenshaase
You can do something like this: (php/-> (php/new \Phel\Compiler\CompilerFacade) (eval "(+ 1 1)"))
1 reply
Mario Bašić
@mabasic
I have a issue when having two foreach loop inside a do loop, the second foreach loop does not even trigger, but the code before it and after it runs normally. This is after updating to 0.3.1. I need to verify this before posting a issue
Mario Bašić
@mabasic
I was missing (foreach [k v (persistent parameters)] ...) because foreach can only work on persistent data structures not transient.
Mario Bašić
@mabasic
There is a bug in mabasic/phel-json library, but I can't figure it out. For some reason some keys are not being persisted in a hash-map.
Jens Haase
@jenshaase
Example?
Mario Bašić
@mabasic
I will push test code with the failing test. Just a sec

Clone the repo: https://github.com/mabasic/phel-json

Run:

composer install
vendor/bin/phel test tests/decode/value.phel
Test called test-sample-value-2 will fail
The sample data is from my website where I noticed missing keys and which triggered my validations.
On this line: https://github.com/mabasic/phel-json/blob/master/src/json.phel#L37, if I place a (println (keyword k) (decode-value v)) before, it prints the corrent keys and values, but after the (put they are not in the map.
Mario Bašić
@mabasic
(php/json_decode returns correct keys and values. So the bug is somewhere in decode-value function
Jens Haase
@jenshaase
This looks like a but in Phel. It only adds 16 key/value pairs. I can reproduce it with this call (let [x (transient {})] (for [i :range [0 20]] (put x i i)) (persistent x))
Mario Bašić
@mabasic
Nice catch! Do you want me to open a issue or will you?
Jens Haase
@jenshaase
Yes, please
Mario Bašić
@mabasic
Jens Haase
@jenshaase:matrix.org
[m]
Thanks. I will have a look in the evening.
Jens Haase
@jenshaase
I just published Version 0.3.2 with a fix for #289
Mario Bašić
@mabasic
Thank you for the fixes and the release. I've updated phel in phel-json library and on my website. It works. The blog is now available here: https://mariobasic.com/blog The posts are old, but new content will be up in a few days. I've managed to implement a lot of stuff already like defining routes like /{year}/{month}/{day}/{slug} and then in the response function you can destructure the parameters that you need like so: (defn render [request & [{:year year :month month :day day :slug slug}]]
The only thing missing now is the compile command. Is there a roadmap somewhere?
Jens Haase
@jenshaase
The compile command is in progress I have a concept and already did some refactoring to make it happen. It is planned for version 0.4.0
Mario Bašić
@mabasic
Awesome!
Mario Bašić
@mabasic
Not to brag, but here is the lighthouse score for my website :D Screenshot (15).png They only took 1 point for initial server response time.
Jens Haase
@jenshaase
I just published a new release (v0.3.3). This fixes a problem when iterating over a vector.
Mario Bašić
@mabasic
What was the problem?
Jens Haase
@jenshaase
The problem happened on Vectors with the size of length % 32 == 0. The RangeIterator for this case had a bug that I fixed now. (See #302)
Jose Maria Valera Reales
@Chemaclass

You can now use $_ to get the latest result from the REPL (from master branch)

See: phel-lang/phel-lang#310

Jens Haase
@jenshaase
Hi everybody. The Phel website got a little redesign. We now integrated a exercises section where you can practice your knowledge. :)
1 reply
Jose Maria Valera Reales
@Chemaclass
Bugfix: Load replStartupFile on ReplCommand->execute()
phel-lang/phel-lang#342
Mario Bašić
@mabasic
FYI: In the latest version of VS Code you can set "editor.bracketPairColorization.enabled": true, and then you don't need the extension for coloring matching brackets.