Comments (5)
Just to be clear, the current readme is very old and out of date. The updated docs are http://scriptor.github.com/pharen/index.html.
There is a working macro reader, meaning you can quote, unquote, and splice. The # character is currently being used to specify function names when they are used as values:
(fn foo (val) (* val 2))
(map #foo [1 2 3]) ; Returns [2 4 6]
Normally in PHP, you would use regular strings: "foo". This won't work because Pharen does some processing to the names such as converting dashes to underscores, and it won't do that in regular strings.
from pharen.
actualli i try to make some example of onlisp with pharen with thinks like macros that define macros but i have some errors when i compile to php.
Have you try some example from onlisp? can i help you on macro definition?
from pharen.
I haven't tried using some of the examples from onlisp. Can you send me some of the code?
Also, make sure you are following the documentation from the link I posted above.
from pharen.
for example this macro in lisp return another macro in lisp
(defmacro propmacro (propname)
‘(defmacro ,propname (obj)
‘(get ,obj ’,’,propname)))
i have tried to use with pharen but i get always error
from pharen.
Could you paste the Pharen code that you use? Also, remember that the unquote symbol in Pharen is ~ (tilde) not , (comma).
Also, I just realized that there is a bug when you try to unquote list/dictionary indexing. For example:
(defmacro foo-key (d) '(~:dict "foo"))
This gives an error.
Otherwise, a macro that returns another macro should be possible.
EDIT: Since this seems to be separate from the original issue, I will create another issue for the list/dictionary indexing bug. Otherwise, if you continue having problems with the macro-inside-macro code, please make sure your version of Pharen is updated. If you still have problems, create another issue so that it can be handled separately from others.
from pharen.
Related Issues (20)
- Passing anonymous function (php 5.3) HOT 3
- Function argument types HOT 3
- test func_calls not pass HOT 2
- problem with array (Update: discussion on vectors) HOT 9
- Deploying Pharen to a server HOT 1
- Defining namespaces break compilation inside macros
- Missing "use" keyword for Plambdas HOT 2
- Installation in Windows HOT 1
- Form handling - example from Quick Tutorial HOT 4
- Developer's machine-specific paths are in distribution HOT 1
- Basic web site example with Pharen - invitation HOT 1
- (load file) is broken for more than one level (load file 1(load file 2 (load file 3))) for a once off compile
- Lexical::init_closure(naming) is unexpected when (load file) is used
- URLs aren't going to where is intended. HOT 1
- Compile errors HOT 2
- Can't find in docs, how do I define a top level namespace? Also optional function args? HOT 5
- http://www.pharen.org/repl.html throws 404
- I want to remove Partial application
- Repl return 404 HOT 1
- How do I define a macro separately in a .phn file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pharen.