FAQ
Hi,

I am new to clojure and I was wondering if there is a macro I can use to
fully expand all symbols and macros in a form, without performing the final
evaluation of the built in functions?

Thanks

Andy

--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Guru Devanla at Nov 25, 2013 at 1:04 pm
    Hi Andy,

    Doesn't macroexpand do what you are looking for?

    Thx

    On Mon, Nov 25, 2013 at 4:55 AM, Andy Smith wrote:

    Hi,

    I am new to clojure and I was wondering if there is a macro I can use to
    fully expand all symbols and macros in a form, without performing the final
    evaluation of the built in functions?

    Thanks

    Andy

    --
    --
    You received this message because you are subscribed to the Google
    Groups "Clojure" group.
    To post to this group, send email to clojure@googlegroups.com
    Note that posts from new members are moderated - please be patient with
    your first post.
    To unsubscribe from this group, send email to
    clojure+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/clojure?hl=en
    ---
    You received this message because you are subscribed to the Google Groups
    "Clojure" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to clojure+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    --
    You received this message because you are subscribed to the Google
    Groups "Clojure" group.
    To post to this group, send email to clojure@googlegroups.com
    Note that posts from new members are moderated - please be patient with your first post.
    To unsubscribe from this group, send email to
    clojure+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/clojure?hl=en
    ---
    You received this message because you are subscribed to the Google Groups "Clojure" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Andy Smith at Nov 25, 2013 at 2:32 pm
    It doesnt seem to expand function calls though right?
    On Monday, 25 November 2013 12:55:27 UTC, Andy Smith wrote:

    Hi,

    I am new to clojure and I was wondering if there is a macro I can use to
    fully expand all symbols and macros in a form, without performing the final
    evaluation of the built in functions?

    Thanks

    Andy
    --
    --
    You received this message because you are subscribed to the Google
    Groups "Clojure" group.
    To post to this group, send email to clojure@googlegroups.com
    Note that posts from new members are moderated - please be patient with your first post.
    To unsubscribe from this group, send email to
    clojure+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/clojure?hl=en
    ---
    You received this message because you are subscribed to the Google Groups "Clojure" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Guru Devanla at Nov 25, 2013 at 5:16 pm
    Hi Andy,

    Not sure what you need in terms of function calls being expanded. Can you
    provide an example.

    Here is an silly example, even though this kind of macro is not needed:

    (def addone [v]
         (+ v 1)

    (defmacro testmacro [init]
        (list 'addone init))

    (macroexpand '(testmacro 10))

    expands to

    (addone 10)

    Thanks
    Guru

    On Mon, Nov 25, 2013 at 6:32 AM, Andy Smith wrote:

    It doesnt seem to expand function calls though right?

    On Monday, 25 November 2013 12:55:27 UTC, Andy Smith wrote:

    Hi,

    I am new to clojure and I was wondering if there is a macro I can use to
    fully expand all symbols and macros in a form, without performing the final
    evaluation of the built in functions?

    Thanks

    Andy
    --
    --
    You received this message because you are subscribed to the Google
    Groups "Clojure" group.
    To post to this group, send email to clojure@googlegroups.com
    Note that posts from new members are moderated - please be patient with
    your first post.
    To unsubscribe from this group, send email to
    clojure+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/clojure?hl=en
    ---
    You received this message because you are subscribed to the Google Groups
    "Clojure" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to clojure+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    --
    You received this message because you are subscribed to the Google
    Groups "Clojure" group.
    To post to this group, send email to clojure@googlegroups.com
    Note that posts from new members are moderated - please be patient with your first post.
    To unsubscribe from this group, send email to
    clojure+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/clojure?hl=en
    ---
    You received this message because you are subscribed to the Google Groups "Clojure" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Andy Smith at Nov 25, 2013 at 7:24 pm
    In your example a full expansion might be : (. clojure.lang.Numbers (add 10
    1))

    On Monday, 25 November 2013 17:16:42 UTC, Guru Devanla wrote:

    Hi Andy,

    Not sure what you need in terms of function calls being expanded. Can you
    provide an example.

    Here is an silly example, even though this kind of macro is not needed:

    (def addone [v]
    (+ v 1)

    (defmacro testmacro [init]
    (list 'addone init))

    (macroexpand '(testmacro 10))

    expands to

    (addone 10)

    Thanks
    Guru


    On Mon, Nov 25, 2013 at 6:32 AM, Andy Smith <the4th...@googlemail.com<javascript:>
    wrote:
    It doesnt seem to expand function calls though right?

    On Monday, 25 November 2013 12:55:27 UTC, Andy Smith wrote:

    Hi,

    I am new to clojure and I was wondering if there is a macro I can use to
    fully expand all symbols and macros in a form, without performing the final
    evaluation of the built in functions?

    Thanks

    Andy
    --
    --
    You received this message because you are subscribed to the Google
    Groups "Clojure" group.
    To post to this group, send email to clo...@googlegroups.com<javascript:>
    Note that posts from new members are moderated - please be patient with
    your first post.
    To unsubscribe from this group, send email to
    clojure+u...@googlegroups.com <javascript:>
    For more options, visit this group at
    http://groups.google.com/group/clojure?hl=en
    ---
    You received this message because you are subscribed to the Google Groups
    "Clojure" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to clojure+u...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    --
    You received this message because you are subscribed to the Google
    Groups "Clojure" group.
    To post to this group, send email to clojure@googlegroups.com
    Note that posts from new members are moderated - please be patient with your first post.
    To unsubscribe from this group, send email to
    clojure+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/clojure?hl=en
    ---
    You received this message because you are subscribed to the Google Groups "Clojure" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • John D. Hume at Nov 25, 2013 at 8:44 pm
    You won't find the results as easy to read as what you're asking for, but
    clojure.tools.analyzer will show you calls that have been inlined by the
    compiler.
    On Nov 25, 2013 2:24 PM, "Andy Smith" wrote:

    In your example a full expansion might be : (. clojure.lang.Numbers (add
    10 1))

    On Monday, 25 November 2013 17:16:42 UTC, Guru Devanla wrote:

    Hi Andy,

    Not sure what you need in terms of function calls being expanded. Can you
    provide an example.

    Here is an silly example, even though this kind of macro is not needed:

    (def addone [v]
    (+ v 1)

    (defmacro testmacro [init]
    (list 'addone init))

    (macroexpand '(testmacro 10))

    expands to

    (addone 10)

    Thanks
    Guru

    On Mon, Nov 25, 2013 at 6:32 AM, Andy Smith wrote:

    It doesnt seem to expand function calls though right?

    On Monday, 25 November 2013 12:55:27 UTC, Andy Smith wrote:

    Hi,

    I am new to clojure and I was wondering if there is a macro I can use
    to fully expand all symbols and macros in a form, without performing the
    final evaluation of the built in functions?

    Thanks

    Andy
    --
    --
    You received this message because you are subscribed to the Google
    Groups "Clojure" group.
    To post to this group, send email to clo...@googlegroups.com
    Note that posts from new members are moderated - please be patient with
    your first post.
    To unsubscribe from this group, send email to
    clojure+u...@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/clojure?hl=en
    ---
    You received this message because you are subscribed to the Google
    Groups "Clojure" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to clojure+u...@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    --
    You received this message because you are subscribed to the Google
    Groups "Clojure" group.
    To post to this group, send email to clojure@googlegroups.com
    Note that posts from new members are moderated - please be patient with
    your first post.
    To unsubscribe from this group, send email to
    clojure+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/clojure?hl=en
    ---
    You received this message because you are subscribed to the Google Groups
    "Clojure" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to clojure+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    --
    You received this message because you are subscribed to the Google
    Groups "Clojure" group.
    To post to this group, send email to clojure@googlegroups.com
    Note that posts from new members are moderated - please be patient with your first post.
    To unsubscribe from this group, send email to
    clojure+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/clojure?hl=en
    ---
    You received this message because you are subscribed to the Google Groups "Clojure" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Gary Verhaegen at Nov 25, 2013 at 9:12 pm
    Not sure it covers what you're asking for, but if you want to manually step
    through your function calls, you can use syntax-quote, provided that you
    have access to the spurce code of the functions you want to step through.

    Or you can try the debuggers in Clojure-enabled IDEs like Eclipse and
    IntelliJ.
    On Monday, 25 November 2013, John D. Hume wrote:

    You won't find the results as easy to read as what you're asking for, but
    clojure.tools.analyzer will show you calls that have been inlined by the
    compiler.
    On Nov 25, 2013 2:24 PM, "Andy Smith" wrote:

    In your example a full expansion might be : (. clojure.lang.Numbers (add
    10 1))


    On Monday, 25 November 2013 17:16:42 UTC, Guru Devanla wrote:

    Hi Andy,

    Not sure what you need in terms of function calls being expanded. Can you
    provide an example.

    Here is an silly example, even though this kind of macro is not needed:

    (def addone [v]
    (+ v 1)

    (defmacro testmacro [init]
    (list 'addone init))

    (macroexpand '(testmacro 10))

    expands to

    (addone 10)

    Thanks
    Guru


    On Mon, Nov 25, 2013 at 6:32 AM, Andy Smith wrote:

    It doesnt seem to expand function calls though right?


    On Monday, 25 November 2013 12:55:27 UTC, Andy Smith wrote:

    Hi,

    I am new to clojure and I was wondering if there is a macro I can use to
    fully expand all symbols and macros in a form, without performing the final
    evaluation of the built in functions?

    Thanks

    Andy

    --
    --
    You received this message because you are subscribed to the Google
    Groups "Clojure" group.
    To post to this group, send email to clo...@googlegroups.com
    Note that posts from new members are moderated - please be patient with
    your first post.
    To unsubscribe from this group, send email to
    clojure+u...@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/clojure?hl=en
    ---
    You received this message because you are subscribed to the Google Groups
    "Clojure" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to clojure+u...@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.


    --
    --
    You received this message because you are subscribed to the Google
    Groups "Clojure" group.
    To post to this group, send email to clojure@googlegroups.com
    Note that posts from new members are moderated - please be patient with
    your first post.
    To unsubscribe from this group, send email to
    clojure+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/clojure?hl=en
    ---
    You received this message because you are subscribed to the Google Groups
    "Clojure" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to
    --
    --
    You received this message because you are subscribed to the Google
    Groups "Clojure" group.
    To post to this group, send email to clojure@googlegroups.com
    Note that posts from new members are moderated - please be patient with your first post.
    To unsubscribe from this group, send email to
    clojure+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/clojure?hl=en
    ---
    You received this message because you are subscribed to the Google Groups "Clojure" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Alex Miller at Nov 25, 2013 at 10:06 pm
    You might find tools.trace useful for examining a form as it is executed.
      https://github.com/clojure/tools.trace

    On Monday, November 25, 2013 6:55:27 AM UTC-6, Andy Smith wrote:

    Hi,

    I am new to clojure and I was wondering if there is a macro I can use to
    fully expand all symbols and macros in a form, without performing the final
    evaluation of the built in functions?

    Thanks

    Andy
    --
    --
    You received this message because you are subscribed to the Google
    Groups "Clojure" group.
    To post to this group, send email to clojure@googlegroups.com
    Note that posts from new members are moderated - please be patient with your first post.
    To unsubscribe from this group, send email to
    clojure+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/clojure?hl=en
    ---
    You received this message because you are subscribed to the Google Groups "Clojure" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Andy Smith at Nov 28, 2013 at 9:54 pm
    thanks for your helpful suggestions.

    --
    --
    You received this message because you are subscribed to the Google
    Groups "Clojure" group.
    To post to this group, send email to clojure@googlegroups.com
    Note that posts from new members are moderated - please be patient with your first post.
    To unsubscribe from this group, send email to
    clojure+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/clojure?hl=en
    ---
    You received this message because you are subscribed to the Google Groups "Clojure" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupclojure @
categoriesclojure
postedNov 25, '13 at 12:55p
activeNov 28, '13 at 9:54p
posts9
users5
websiteclojure.org
irc#clojure

People

Translate

site design / logo © 2022 Grokbase