JesusValera on refactor-repl-command
Use gacela:dev-master branch (compare)
Chemaclass on refactor-repl-command
Preparing ReplCommandTest. Thi… (compare)
JesusValera on refactor-repl-command
Move logic from ReplCommand to … (compare)
The quickest way to try out Phel is to run our REPL Docker container.
docker run -it --rm phellang/repl
Kudos to @jenshaase -> https://phel-lang.org/#try-phel
out-dir
set in phel-config.php
and composer.json
references running a local php webserver, and public/index.php
contains code that references the compiled phel code
phel compile
phel compile
it'll compile the phel language into dist
but my custom code doesn't seem to be written into dist
phel compile
, is there a recommended way to get around this?
*compile-mode*
variable as a condition: https://phel-lang.org/documentation/api/#compile-mode
diff --git a/src/boot.phel b/src/boot.phel
index 529c0c5..32facf4 100644
--- a/src/boot.phel
+++ b/src/boot.phel
@@ -6,4 +6,5 @@
(php/-> site-app (get "/" (fn [] (php/:: Response (plaintext "Hello There")))))
-(php/-> site-app (run))
\ No newline at end of file
+(when-not *compile-mode*
+ (php/-> site-app (run)))
use
in closures, return new React\Promise\Promise(function ($resolve, $reject) use ($body)
how would I represent that in phel?
use
is not required in phel. You can just use fn and reference variables outside of the scope of the function.
my-type-with-two-interfaces
is a PHP class that implements the interfaces MyFirstInterface
and MySecondInterface
.
stripos(): Argument #1 ($haystack) must be of type string, null given
#0 D:\farid\phel\hello-world\vendor\phel-lang\phel-lang\src\php\Run\Domain\Repl\ReplCommandSystemIo.php(71): stripos(NULL, 'editline')
#1 D:\farid\phel\hello-world\vendor\phel-lang\phel-lang\src\php\Run\Command\ReplCommand.php(127): Phel\Run\Domain\Repl\ReplCommandSystemIo->isBracketedPasteSupported()
#2 D:\farid\phel\hello-world\vendor\phel-lang\phel-lang\src\php\Run\Command\ReplCommand.php(110): Phel\Run\Command\ReplCommand->addLineFromPromptToBuffer()
#3 D:\farid\phel\hello-world\vendor\phel-lang\phel-lang\src\php\Run\Command\ReplCommand.php(101): Phel\Run\Command\ReplCommand->loopReadLineAndAnalyze()
#4 D:\farid\phel\hello-world\vendor\symfony\console\Command\Command.php(298): Phel\Run\Command\ReplCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 D:\farid\phel\hello-world\vendor\symfony\console\Application.php(1015): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 D:\farid\phel\hello-world\vendor\symfony\console\Application.php(299): Symfony\Component\Console\Application->doRunCommand(Object(Phel\Run\Command\ReplCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 D:\farid\phel\hello-world\vendor\symfony\console\Application.php(171): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 D:\farid\phel\hello-world\vendor\phel-lang\phel-lang\phel(42): Symfony\Component\Console\Application->run()
#9 D:\farid\phel\hello-world\vendor\bin\phel(117): include('D:\\farid\\phel\\h...')
#10 {main}
SpecialForm
that I did miss a year ago when I was working on them, and I learned a lot by doing this. I found this now, so instead of doing them myself, I think it's good to let others try themselves if someone wants to contribute doing anything but they don't know where to start. These are like "exclusives testing katas" with a lot of learning opportunities :)